You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _docs/promotions/promotion-context-promotion-workflows.md
+14-11Lines changed: 14 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,13 +103,14 @@ max-width="60%"
103
103
104
104
##Walkthough: Using promotion hooks in Promotion Flows to handle promotion failures
105
105
106
-
If you are familir with promotion hooks, you know that they are meant to take action or provude information for the release and environments when a promotion is intiated.
107
-
In this walkthrough we'll show you how to use hooks to handle promotion failures so that users or staeksholders get all the information they need in a timely manner without needing or having to monio the release.
106
+
Promotion hooks are designed to take action or provide information related to a release and its environments when a promotion is triggered.
107
+
In this walkthrough, you'll see how to use promotion hooks to handle promotion failures, ensuring that stakeholders are notified with the right information—without needing to monitor the release manually.
108
+
109
+
This walkthrough covers:
110
+
*[Creating Promotion Workflows with hooks](#create-promotion-workflows-with-hooks)
111
+
*[Assigning hooks in Promotion Flow](#assign-hooks-to-promotion-flow)
112
+
*[Triggering hooks in Promotion Flow](#result-of-triggering-hooks-1-and-2-work-in-the-promotion-flow)
108
113
109
-
This walkthgoh
110
-
1. Creating the hooks
111
-
1. Assignig hooks to a Promotion Flow
112
-
1. See result
113
114
114
115
###Create Promotion Workflows with hooks
115
116
@@ -125,11 +126,12 @@ This hook performs two main actions:
125
126
|**Two-step DAG structure**| The hook uses a Directed Acyclic Graph (DAG) with two tasks: first`create-issue`, then`set-promotion-context`. The second task depends on the successful creation of the Jira issue.|
126
127
|**Jira issue creation**| The`create-issue` task uses a custom container to create a Jira ticket.|
127
128
|**Promotion context definition**| After creating the Jira issue, the`set-promotion-context` task creates a JSON object with the full Jira issue URL. This JSON is saved to`/tmp/promotion-context.txt` and exported as the`PROMOTION_CONTEXT` global output.|
128
-
|**Sharing information across hooks**| By exporting`PROMOTION_CONTEXT`, later hooks in the same Promotion Flow, have access to the Jira issuedetails.|
129
+
|**Sharing information across hooks**| By exporting`PROMOTION_CONTEXT`, later hooks in the same Promotion Flow, have access to the Jira issueURL.|
129
130
130
131
131
132
132
133
134
+
#####Example YAML
133
135
```yaml
134
136
apiVersion:argoproj.io/v1alpha1
135
137
kind:WorkflowTemplate
@@ -255,8 +257,9 @@ spec:
255
257
valueFrom:
256
258
path:/tmp/promotion-context.txt
257
259
```
260
+
<br><br>
258
261
259
-
#### Hook 2: Create a hook that sends a Slack notificationwith
262
+
#### Hook 2: Create a hook that sends a Slack notification
260
263
This hook sends a Slack notification when a promotion fails. It uses the promotion context set by the Jira creation hook to include a direct link to the Jira issue in the Slack message.
261
264
262
265
@@ -269,7 +272,7 @@ This hook sends a Slack notification when a promotion fails. It uses the promoti
269
272
| **Simple and reusable Slack template** | The hook uses a standard Slack webhook and a flexible `SLACK_TEXT` format, making it easy to modify for different products or flows without changing the container logic. |
270
273
| **Promotion context usage** | The `JIRA_ISSUE_URL` from the promotion context created in the previous hook is injected into the Slack message, linking the notification directly to the Jira ticket for tracking. |
271
274
272
-
275
+
##### Example YAML
273
276
```yaml
274
277
apiVersion: argoproj.io/v1alpha1
275
278
kind: WorkflowTemplate
@@ -362,8 +365,8 @@ max-width="60%"
362
365
363
366
364
367
365
-
###How Hooks 1 and 2 work in the Promotion Flow
366
-
The table describeshowthe two hooksinteract to provide the
368
+
###Result of triggering Hooks 1 and 2 work in the Promotion Flow
369
+
The table describesthe results whenthe two hooksare triggered.