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

Commit3360c86

Browse files
committed
Add new articles fro service accounts and promotion contexts
1 parent0a485f7 commit3360c86

13 files changed

+371
-308
lines changed

‎_data/argohub-nav.yml‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,13 +255,17 @@
255255
-title:Promotion setup guidelines
256256
url:"/create-promotion-sequence"
257257
-title:Promotion Flows
258-
url:"/promotion-flow"
259-
-title:Promotion hooks
260-
url:"/promotion-hooks"
258+
url:"/promotion-flow"
261259
-title:Promotion Policies
262260
url:"/promotion-policy"
263261
-title:Promotion Workflows
264-
url:"/promotion-workflow"
262+
url:"/promotion-workflow"
263+
-title:Service accounts for Promotion Workflows
264+
url:"/service-accounts-promotion-workflows"
265+
-title:Promotion hooks
266+
url:"/promotion-hooks"
267+
-title:Promotion contexts in promotion hooks
268+
url:"/promotion-context-promotion-workflows"
265269
-title:Product promotion settings
266270
url:"/product-promotion-props"
267271
-title:Promotion entity YAMLs

‎_data/nav.yml‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,13 +434,17 @@
434434
-title:Promotion setup guidelines
435435
url:"/create-promotion-sequence"
436436
-title:Promotion Flows
437-
url:"/promotion-flow"
438-
-title:Promotion hooks
439-
url:"/promotion-hooks"
437+
url:"/promotion-flow"
440438
-title:Promotion Policies
441439
url:"/promotion-policy"
442440
-title:Promotion Workflows
443441
url:"/promotion-workflow"
442+
-title:Service accounts for Promotion Workflows
443+
url:"/service-accounts-promotion-workflows"
444+
-title:Promotion hooks
445+
url:"/promotion-hooks"
446+
-title:Promotion contexts in promotion hooks
447+
url:"/promotion-context-promotion-workflows"
444448
-title:Product promotion settings
445449
url:"/product-promotion-props"
446450
-title:Promotion entity YAMLs

‎_docs/promotions/create-promotion-sequence.md‎

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Promotions are a critical part of continuous delivery, enabling you to move chan
1414

1515
##Prerequisites
1616
1.[Configuration Runtime]({{site.baseurl}}/docs/installation/gitops/configuration-runtime/)
17-
The Configuration Runtime is a GitOps Runtime that stores promotion-related entities.
17+
The Configuration Runtime is a GitOps Runtime that storesconfiguration for GitOpspromotion entities.
1818
* Designate at least one GitOps Runtime as the Configuration Runtime.
1919
* If no GitOps Runtime has been designated as such, Codefresh assigns one of the existing Runtimes.
2020

@@ -24,10 +24,12 @@ Promotions are a critical part of continuous delivery, enabling you to move chan
2424
1.[User permissions]({{site.baseurl}}/docs/administration/account-user-management/gitops-abac/)
2525
Users need permissions to create Promotion Workflows, configure promotion settings for products, and trigger promotions.
2626

27+
28+
##Setup tasks
2729
1.[Create environments]({{site.baseurl}}/docs/environments/create-manage-environments/#create-environments)
2830
Environments define the starting point and destination of promotions.
2931
A promotion requires at least two environments:
30-
* Triggerenvironment, the source of the changes being promoted
32+
* TriggerEnvironment, the source of the changes being promoted
3133
* Target environment, to which to promote the changes
3234

3335
1.[Create applications]({{site.baseurl}}/docs/deployments/gitops/create-application/#create-an-argo-cd-application)
@@ -43,26 +45,39 @@ Promotions are a critical part of continuous delivery, enabling you to move chan
4345

4446
1.[Create Promotion Workflows]({{site.baseurl}}/docs/promotions/promotion-workflow/)
4547
Promotion Workflows (Argo Workflows) automate environment-specific tests and validations before and after promotion.
46-
* Create and use Promotion Workflows to run smoke tests, database validation, and other requirements to verify readiness.
48+
* Create Promotion Workflows to run smoke tests, database validation, and any other requirements to verify readiness of each application in an environment.
49+
50+
1.[Create Promotion Workflows with hooks]({{site.baseurl}}/docs/promotions/promotion-hooks/)
51+
Promotion hooks provide promotion status and custom information for releases and environments during the Promotion Flow.
52+
* Create hooks in Promotion Workflows to implement actions such as Slack notifications
53+
* Define and export promotion contexts in hooks to expose and pass custom parameters such as Jira ID
54+
4755

4856
1.[Define Promotion Policies]({{site.baseurl}}/docs/promotions/promotion-policy/)
4957
Promotion Policies govern promotion behavior for environments enforcing rules, checks, and validations.
5058
* Define policies that combine Promotion Workflows with promotion actions such as commits, pull requests
5159
* The policy mechanism merges relevant settings from global policies according to priority, enforcing automated governance
5260

61+
5362
1.[Create Promotion Flows]({{site.baseurl}}/docs/promotions/promotion-flow/)
5463
Promotion Flows orchestrate the sequence of actions required to move and deploy changes through multiple environments.
5564
* Automatically integrate environments, products, Promotion Workflows, and Promotion Policies into a structured promotion process
65+
* Assign promotion hooks to track release and environment statuses for product releases
5666
* Reuse Promotion Flows across products for consistent and reliable promotions
67+
68+
5769

5870
1.[Customize promotions for products]({{site.baseurl}}/docs/promotions/product-promotion-props/)
5971
After setting up promotion entities, configure additional promotion settings at the product level.
6072
* Promotion Templates to define attributes to be promoted across the product's applications
6173
* Promotion Flows valid for the product and trigger conditions for each flow
6274

75+
##Trigger and monitor promotions
76+
6377
1.[Trigger promotions]({{site.baseurl}}/docs/promotions/trigger-promotions/)
6478
Trigger the promotion manually or automatically.
65-
79+
80+
6681
1.[Monitor promotion releases for products]({{site.baseurl}}/docs/promotions/product-releases/)
6782
Monitor deployment progress as applications move through the promotion sequence.
6883
* Use the Releases feature for products to monitor deployments

‎_docs/promotions/promotion-components.md‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,18 @@ These entities provide additional control and automation, enabling advanced mult
9898
<td>Users with ABAC permissions</td>
9999
<td><a href="https://codefresh.io/docs/docs/products/configure-product-settings/">Promotion settings for products</a></td>
100100
</tr>
101-
<tr>
101+
<tr>
102102
<td><strong>Promotion Workflow</strong></td>
103-
<td>An Argo Workflow which runs tests and validations during promotion for each environment. Promotion Workflows can include smoke tests, rollback mechanisms, database validation checks, performance checks, and more.</td>
103+
<td>An Argo Workflow which runs tests and validations during promotion for eachapplication within anenvironment. Promotion Workflows can include smoke tests, rollback mechanisms, database validation checks, performance checks, and more.</td>
104104
<td>Users with ABAC permissions</td>
105105
<td><a href="https://codefresh.io/docs/docs/promotions/promotion-workflow/">Promotion Workflows</a></td>
106106
</tr>
107+
<tr>
108+
<td><strong>Promotion hooks</strong></td>
109+
<td>Promotion hooks are configured in Promotion Workflows to run at the start or end of a product release, or at the start or end of promotions in environments. Promotion hooks can include notifications and actions such as sending Slack messages or custom issue-tracking information based on the status of the promotion for release or environment.</td>
110+
<td>Users with ABAC permissions</td>
111+
<td><a href="https://codefresh.io/docs/docs/promotions/promotion-hooks/">Promotion Workflows</a></td>
112+
</tr>
107113
<tr>
108114
<td><strong>Promotion Policy</strong></td>
109115
<td>Defines promotion behavior for environments by combining Promotion Workflows (tests and validations), with the promotion action such as commits or pull requests.</td>
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
title:"Promotion contexts for promotion hooks"
3+
description:"Use promotion contexts to expose custom parameters to hooks in Promotion Flows"
4+
group:promotions
5+
toc:true
6+
---
7+
8+
9+
10+
11+
##Promotion contexts in promotion hooks
12+
Promotion Workflows with hooks in GitOps Cloud have access to a standard set of[default parameters]({{site.baseurl}}/docs/promotions/promotion-hooks/#default-arguments-in-promotion-hooks), such as the release ID, product, and commit SHA.
13+
For promotion hooks to have access to additional, custom parameters that are not natively available, you need to use**promotion contexts**.
14+
15+
Because promotion hooks run within GitOps Runtimes in your own clusters, they do not automatically have access to custom internal parameters. To pass custom values like Jira ticket IDs, approver names, or Slack channel information between hooks in the same Promotion Flow, you must define and export a promotion context, which is a user-defined JSON object. See[Creating and exporting a promotion context](#creating-and-exporting-a-promotion-context).
16+
17+
Each hook in the Promotion Flow has access to the information it needs, no matter where it's running.
18+
This ability to pass custom data across hooks can help with scenarios like notifying specific Slack channels or tracking specific Jira tickets associated with the promotion process. See[Example of Promotion Workflow with promotion context](#example-of-promotion-workflow-with-promotion-context) and[How promotion context works during execution](#how-promotion-context-works-during-execution).
19+
20+
21+
##Creating and exporting a promotion context
22+
You can use any method to create a promotion context as a JSON object and define the parameters you need.
23+
The key step is**exporting the promotion context**, as this makes its content available to the Promotion Workflow.
24+
25+
Export the promotion context as an output parameter and make it available to the promotion mechanism:
26+
* Add`PROMOTION_CONTEXT` as the`name` to`outputs.parameters`._The name must not be changed_.
27+
* Add the`globalName` attribute to make it available globally. The value must match the name of the promotion context.
28+
* Add the`valueFrom` attribute to reference the file path.
29+
30+
31+
##Example of Promotion Workflow with promotion context
32+
The example creates a promotion context`PROMOTION_CONTEXT` as a JSON object and exports it as an output parameter.
33+
* The promotion context defines`JIRA_ISSUE_SOURCE_FIELD` and`JIRA_BASE_URL`
34+
* Writes the context to a file`/tmp/promotion-context.txt`
35+
* Adds`PROMOTION_CONTEXT` to`outputs.parameters.name`, defines`globalName` as the name of the promotion context, and in`valueFrom.path` specifies the file path where the promotion context JSON was saved for GitOps Cloud to retrieve and pass on to subsequent Promotion Workflows.
36+
37+
38+
```yaml
39+
...
40+
spec:
41+
...
42+
-name:set-promotion-context
43+
serviceAccountName:hook
44+
inputs:
45+
parameters:
46+
-name:JIRA_ISSUE_SOURCE_FIELD
47+
-name:JIRA_BASE_URL
48+
script:
49+
image:alpine
50+
command:
51+
-sh
52+
source:|
53+
export JIRA_ISSUE_BASE_URL="{{inputs.parameters.JIRA_BASE_URL}}"
54+
export JIRA_ISSUE_SOURCE_FIELD="{{inputs.parameters.JIRA_ISSUE_SOURCE_FIELD}}"
55+
PROMOTION_CONTEXT=$(echo "{\"JIRA_ISSUE_URL\": \"${JIRA_ISSUE_BASE_URL}/browse/${JIRA_ISSUE_SOURCE_FIELD}\"}")
56+
echo "$PROMOTION_CONTEXT" > /tmp/promotion-context.txt
57+
outputs:
58+
parameters:
59+
-name:PROMOTION_CONTEXT# cannot be changed
60+
globalName:PROMOTION_CONTEXT# name of promotion context
61+
valueFrom:
62+
path:/tmp/promotion-context.txt
63+
...
64+
```
65+
66+
##How promotion context works during execution
67+
68+
When a hook exports 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. The promotion context is saved in the GitOps Cloud platform.
69+
70+
This ensures:
71+
* Context values persist across environments and clusters
72+
* If a hook redefines a parameter already in the context, the new value takes precedence
73+
74+
75+
#####Triggering the first promotion hook
76+
When the Promotion Flow is triggered and a product release is created, the promotion mechanism:
77+
* Passes the default metadata (release ID, commit SHA for example) to all hooks configured for the Promotion Flow
78+
* Initializes the promotion context, if defined and exported, with custom values
79+
80+
#####Triggering subsequent promotion hooks
81+
As the Flow progresses, the promotion mechanism:
82+
* Retrieves the promotion context from the previous hook
83+
* Passes the context automatically to the next hook as input parameters:
84+
* New parameters are added to the input parameters of the next hook
85+
* For existing parameters, the value of the parameter in the current hook always takes precedence
86+
87+
88+
89+
{% include
90+
image.html
91+
lightbox="true"
92+
file="/images/gitops-promotions/hooks/promotion-context-behavior.png"
93+
url="/images/gitops-promotions/hooks/promotion-context-behavior.png"
94+
alt="Promotion context shared across promotion hooks in Promotion Flow"
95+
caption="Promotion context shared across promotion hooks in Promotion Flow"
96+
max-width="60%"
97+
%}
98+
99+
##Related articles
100+
[Configure Promotion Workflows]({{site.baseurl}}/docs/promotions/promotion-workflow/)
101+
[Configure hooks in Promotion Workflows]({{site.baseurl}}/docs/promotions/promotion-hooks/)
102+
[Configure Promotion Flows]({{site.baseurl}}/docs/promotions/promotion-flow/)

‎_docs/promotions/promotion-flow.md‎

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,28 @@ Although this behavior may seem intuitive, it’s crucial to recognize that each
150150

151151
Adding or deleting files from applications in target environments does not affect the Promotion Flow. The promotion mechanism simply retains the added/deleted files as they are in the target environments.
152152

153+
###Hooks in Promotion Flows
154+
Promotion hooks provide promotion status and custom information for releases and environments during the Promotion Flow.
155+
* Hooks are configured in Promotion Workflows and assigned to start/end of the release or specific environments in the Promotion Flow.
156+
* All hooks receive a default set of arguments to configure actions or notifications based on success or failure.
157+
* Promotion contexts within hooks when exported, expose custom parameters not natively available to the hooks. For example, you can link a Jira issue by creating a promotion context with the Jira ID and exporting it.
158+
153159

154160
###Promotion Policy settings
155161

156-
For each environment, you can explicitly set the Promotion Policy that defines governs promotion behavior for the environment through the Promotion Action (required), andPre- and Post-Action Workflows.
162+
For each environment, you can explicitly set the Promotion Policy that defines governs promotion behavior for the environment through the Promotion Action (required), and Pre- and Post-Action Workflows.
157163
You can also preview Policy settings by product before the flow is triggered.
158164

165+
{% include
166+
image.html
167+
lightbox="true"
168+
file="/images/gitops-promotions/hooks/promotion-hooks-in-flow.png"
169+
url="/images/gitops-promotions/hooks/promotion-hooks-in-flow.png"
170+
alt="Promotion hooks in Promotion Flow"
171+
caption="Promotion hooks in Promotion Flow"
172+
max-width="60%"
173+
%}
174+
159175
####Inline vs. global Promotion Policy settings
160176

161177
When you create or edit a Promotion Flow, the Flow Builder displays the Pre- and Post-Action Workflows, and the Promotion Action available for selection.
@@ -230,7 +246,7 @@ Visually design and create the flow by selecting environments, Promotion Actions
230246
***Flow Timeout**: The maximum duration allowed for the Promotion Flow to complete execution after being triggered, before it is automatically terminated. If not specified, the default timeout is 1 day (24 hours).
231247
***Version**: (Optional) The version of the Promotion Flow. This is manually defined and manually updated, and is useful to indicate changes in the same flow.
232248
1. In**Select Trigger Environment**, click {::nomarkdown}<imgsrc="/images/icons/plus-icon.png"display=inline-block>{:/} to see the list of available environments:
233-
* Select an existing environment, select it and click**Add**.
249+
* Select an existing environment and click**Add**.
234250
* To create a new environment, click**Add New Environment**.
235251

236252
{% include
@@ -244,7 +260,7 @@ max-width="50%"
244260
%}
245261

246262
{:start="5"}
247-
1. Optional. Toadd a trigger workflow to validate the trigger environment after the change and commit action, mouse over the left of the environment node, and click {::nomarkdown}<imgsrc="../../../../images/icons/flow-builder-add-workflow.png"display=inline-block>{:/}, and select a Workflow.
263+
1. Optional. Toassign a workflow to validate the trigger environment after the change and commit action, mouse over the left of the environment node, and click {::nomarkdown}<imgsrc="../../../../images/icons/flow-builder-add-workflow.png"display=inline-block>{:/}, and select a Workflow.
248264
* To apply a trigger workflow from global Promotion Policy settings, click**Account-level Promotion Policy**.
249265
* To add a new Promotion Workflow as the trigger workflow, click**Add New Workflow**.
250266

@@ -261,7 +277,6 @@ max-width="50%"
261277
{:start="6"}
262278
1. To add a target environment to promote to, either sequentially or in parallel, mouse over the right of the environment to add to, click {::nomarkdown}<imgsrc="../../../../images/icons/plus-icon.png"display=inline-block>{:/} and then select the environment or environments.
263279
The example below shows two environments,`qa` and`staging` as parallel environments to`dev`.
264-
<!--- To add parallel environments, click {::nomarkdown}<img src="../../../../images/icons/plus-icon.png" display=inline-block>{:/} on the right of the previous environment. For example, to add `qa` and `staging` as parallel environments to `dev`, you would click {::nomarkdown}<img src="../../../../images/icons/plus-icon.png" display=inline-block>{:/} on the `dev` environment.-->
265280

266281
{% include
267282
image.html
@@ -320,7 +335,9 @@ caption="Add Pre-/Post-Action Workflows"
320335
max-width="60%"
321336
%}
322337

323-
{:start="10"}
338+
1. To assign promotion hooks to the start or release or to an environment do
339+
340+
{:start="11"}
324341
1. Click**Save Promotion Flow** on the top-right.
325342
The Name and Description are populated from the Settings. The flow's YAML version on the right lists the environment sequence.
326343
1. To confirm, click**Save**.
@@ -401,6 +418,7 @@ TBD
401418
-->
402419

403420
##Related articles
421+
[Hooks in Promotion Flows]({{site.baseurl}}/docs/promotions/promotion-hooks/)
404422
[Trigger promotions]({{site.baseurl}}/docs/promotions/trigger-promotions/)
405423
[Tracking product promotions through releases]({{site.baseurl}}/docs/promotions/product-releases/)
406424
[Promotions: Setup & configuration guidelines]({{site.baseurl}}/docs/promotions/create-promotion-sequence/)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp