Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit01fac1b

Browse files
committed
Update
1 parent3efab63 commit01fac1b

File tree

2 files changed

+31
-32
lines changed

2 files changed

+31
-32
lines changed

‎_docs/promotions/promotion-hooks.md‎

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ toc: true
88

99
##What are promotion hooks?
1010

11-
Promotion hooks inCodefreshGitOps are specialized workflows that run at keypoints duringa product release. A product release is created when a Promotion Flow is manually or automatically triggered.
11+
Promotion hooks in GitOpsCloudare specialized workflows that run at keystages ofa product release. A product release is created when a Promotion Flow istriggered, eithermanually or automatically.
1212

1313
{% include
1414
image.html
@@ -20,13 +20,13 @@ caption="Promotion hooks in Promotion Flow"
2020
max-width="60%"
2121
%}
2222

23-
Promotion hooksare implemented usingthe sameunderlyingmechanism as standard Promotion Workflows, but run with additional context and scope on releases and environments.
24-
Unlike Pre- and Post-Action Promotion Workflows, whichrun in specific environments and target individual applications, promotion hooks runat the release or environment level. They are not tied to a specific deployment or application, making them reusable across multiple flows. Promotion hooks enable real-time alerts, custom logic, and actions—without requiring users to monitor the promotion directly in the UI. Teams can stay informed and respond instantly as promotions progress.
23+
Promotion hooksusethe same mechanism as standard Promotion Workflows but run with additional context and scope on releases and environments.
24+
Unlike Pre- and Post-Action Promotion Workflows, whichoperate on each application within environments, promotion hooks runonce per release or environment. They are not tied to a specific deployment or application, making them reusable across multiple flows. Promotion hooks enable real-time alerts, custom logic, and actions—without requiring users to monitor the promotion directly in the UI. Teams can stay informed and respond instantly as promotions progress.
2525

2626

2727

2828
#####When are promotion hooks triggered?
29-
Promotion hooks can run at different stages of a release:
29+
Promotion hooks can run at different stages of aproductrelease:
3030
***Release start**: When a release is initiated
3131
***Release end**: When a release completes, whether**successful** or**failed**
3232
***Per environment**: When a release transitions through specific environments:
@@ -38,19 +38,19 @@ See [Assigning promotion hooks in Promotion Flows](#assigning-promotion-hooks-in
3838

3939
#####Use cases for promotion hooks
4040
* Auditing and visibility
41-
Capture details on the entirepromotion release and take action
41+
Capture details on the entireproduct release and take action.
4242

4343
* Notifications and reporting
4444
Get timely alerts and notifications on success and failures alike through familiar channels. Send alerts to Slack, email, or monitoring tools based on release events to be always in the loop instead of having to constantly monitor the promotion release.
4545

4646
* Integration with external tools
4747
Automate updates to ticketing systems such as Jira, or observability platforms.
4848

49-
For examples, check out[Codefresh Hub for Argo](https://codefresh.io/argohub/){:target="\_blank"}.
49+
Explore examples in[Codefresh Hub for Argo](https://codefresh.io/argohub/){:target="\_blank"}.
5050

51-
#####Components for promotion hooks
51+
#####Componentsrequiredfor promotion hooks
5252

53-
Forpromotion hooks to work in Promotion Workflows, you need these resources:
53+
To runpromotion hooks in Promotion Workflows, you need these resources:
5454
***(Required) Service account, service account role and role binding**
5555
A default service account, service account role, and role binding, are automatically added to all Workflow Templates when you install the GitOps Runtime. The provided default resources are sufficient to implement promotion hooks. To use your own resources, see[Service accounts & service account roles for promotion hooks](#service-accounts--service-account-roles-for-promotion-hooks).
5656

@@ -63,11 +63,10 @@ The table lists key differences between Promotion Workflows containing hooks and
6363

6464
|**Feature**|**Promotion Hooks**|**Promotion Workflows**|
6565
|----------------|----------------------|-----------------------------------------------|
66-
|**Purpose**| Provides information on the release| Provides information on promoted changes in applications within an environment|
67-
|**Execution**| Runs at release start, end (success, failure), or per environment (start, success, failure)| Runs for each application in an environment before and after promotion|
68-
|**Scope**| Runs on cluster at release or environment level| Runs per application in the environment|
69-
|**Effect on promotion**| Notifies on promotion status| Blocks a promotion if conditions fail|
70-
66+
|**Purpose**| Provides information on the release.| Provides information on promoted changes in applications within an environment.|
67+
|**Execution**| Runs at release start, end (success, failure), or per environment (start, success, failure).| Runs for each application in an environment before and after promotion.|
68+
|**Scope**| Runs on cluster at release or environment (once for each environment) level.| Runs per application in the environment.|
69+
|**Effect on promotion**| {::nomarkdown}<ul><li>If a hook fails, the product release fails as well.</li>If the release is terminated, On Fail and On Release Fail hooks are run.</li>If an On Start or On Success hook fails, the On Fail hook if defined, is run.</li></ul>{:/}| Blocks the promotion when a workflow fails.|
7170

7271

7372
##Promotion hooks in Shared Configuration Repository
@@ -168,15 +167,13 @@ subjects:
168167
```
169168
170169
## Promotion contexts for promotion hooks
171-
All promotion hooks receive a standard set of [default arguments](#default-arguments-in-promotion-hook-workflows) such as the release ID, product, commit SHA from the promotion mechanism.
172-
Toexpose customdata such as Jira ticket IDs, approver names, or Slack channels, and make this data available topromotion hooks in the same Promotion Flow, you must define and export a **promotion context**.
173-
A promotion context is a user-defined JSON objectpassed between hooks in the same Promotion Flow. Itenables sharing valuesthat the promotion mechanism cannot access by default.
170+
All promotion hooks receive a standard set of [default arguments](#default-arguments-in-promotion-hook-workflows) such as the release ID, product, commit SHA.
171+
Topass customvalues such as Jira ticket IDs, approver names, or Slack channels betweenpromotion hooks in the same Promotion Flow, define and export a **promotion context**.
172+
A promotion context is a user-defined JSON objectthatenables sharing valuesnot natively available to the promotion mechanism.
174173
175-
Unlike standard Promotion Workflows which have built-in access to internal context, promotion hooks run within GitOps Runtimes in your own clusters. These hooks do not automatically receive customvalues unless you define and exportthe promotion context.
174+
Unlike standard Promotion Workflows which have built-in access to internal context, promotion hooks run within GitOps Runtimes in your own clusters. These hooks do not automatically receive customparameters unless youexplicitlydefine and exporta promotion context.
176175
177-
Promotion contexts allow you to:
178-
* Expose and store user-defined variables that the promotion mechanism cannot natively access
179-
* Make those variables available as input parameters to subsequent hooks in the same Promotion Flow
176+
Promotion contexts allow you to share user-defined variables across hooks in the Promotion Flow, making them available as input parameters to subsequent hooks.
180177
181178
Examples:
182179
* Send a Slack alert to a specific channel by passing the channel name in the promotion context
@@ -228,29 +225,28 @@ spec:
228225
...
229226
```
230227

231-
### How promotionhooks work during execution
228+
### How promotioncontext works during execution
232229

233-
When you assign Promotion Workflows with promotion hooks in a Promotion Flow, the promotion mechanism runs the hooks at the relevant stages of the Promotion Flow.
234230

235-
#####Promotion context sharing across allpromotionhooks
236-
If a hookincludes a promotion context and exports it, the promotion mechanism passes thosecontextparameters to all subsequent hooks, regardless of whether the hooks include promotion contexts.
231+
#####Sharingpromotioncontext
232+
When a hookexports a promotion context, the promotion mechanism passes those parameters to all subsequent hooks in the Promotion Flow, regardless of whether the hooks include promotion contexts.
237233

238234
This ensures:
239-
*Consistent access to custom data, Jira ticket ID, build number, for example throughout the Promotion Flow
240-
*Parameters remain available across hooks runningindifferent environments or clusters.
235+
*Context values persist across environments and clusters
236+
*If a hook redefines a parameter alreadyinthe context, the new value takes precedence
241237

242238

243239
##### Triggering the first promotion hook
244240
When the Promotion Flow is triggered and a product release is created, the promotion mechanism:
245-
* Passes the defaultpromotionmetadata (release ID, commit SHA for example) to the first hook
246-
* Initializes the promotion context, if defined and exported, withanycustom values
241+
* Passes the default metadata (release ID, commit SHA for example) to the first hook
242+
* Initializes the promotion context, if defined and exported, with custom values
247243

248244
##### Triggering subsequent promotion hooks**
249245
As the Flow progresses, the promotion mechanism:
250246
* Retrieves the promotion context from the previous hook
251247
* Passes the context automatically to the next hook as input parameters:
252-
* Newcustomparameters are added to the input parameters of the next hook.
253-
*If the same custom parameter exists also inthecurrent hook, thevalue in the current hook always takes precedence and overrides the previous one.
248+
* New parameters are added to the input parameters of the next hook
249+
*For existing parameters,thevalue of theparameter in the current hook always takes precedence
254250

255251

256252

@@ -553,8 +549,11 @@ spec:
553549
## Assigning promotion hooks in Promotion Flows
554550

555551
Assign Promotion Workflows with promotion hooks in the Promotion Flow for the release or environments:
556-
* Release-level hooks run before the trigger environment and after the final target environment
557-
* Environment-level hooks run on entry to or exit from each environment
552+
* Release-level hooks run before the trigger environment and after the final target environment.
553+
* Environment-level hooks run on entry to or exit from each environment.
554+
* Multiple hooks can run based the stage in the product release they are configured. Promotion failure for an environment will run both On Fail hooks if configured the environment and for the release.
555+
556+
558557

559558
>**NOTE**
560559
You cannot assign a Promotion Hook Workflow to the Trigger Environment itself.
125 KB
Loading

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp