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

Commit46b23b5

Browse files
committed
First draft of the Promotion workflow quick start
Signed-off-by: lrochette <laurent.rochette@codefresh.io>
1 parenteec2924 commit46b23b5

File tree

2 files changed

+111
-7
lines changed

2 files changed

+111
-7
lines changed

‎_docs/gitops-quick-start/quick-start-promotion-workflow.md‎

Lines changed: 111 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,123 @@ In this quick start guide, we'll see how to create an Argo WorkflowTemplate usin
2020

2121
##Example 1: Slack notification
2222

23-
Creating a Promotion Workflow is as simple as creating an[Argo WorkflowTewmplate[(https://argo-workflows.readthedocs.io/en/latest/workflow-templates/).
23+
Creating a Promotion Workflow is as simple as creating an[Argo WorkflowTewmplate[(https://argo-workflows.readthedocs.io/en/latest/workflow-templates/).
2424
You can do so directly from the UI.
2525

2626
#####Step-by-step
2727

28-
1. In the Codefresh UI, from the sidebar, select**Promotion Workflows**, and click**Add Promotion Workflow**.
28+
1. In the Codefresh UI, from the sidebar, select**Promotion Workflows**, and
29+
click**Add Promotion Workflow**.
2930
1. Define the following:
30-
1.**Name**: A unique name for the Promotion Workflow,`slack-notification` for the quick start.
31-
1.**Description**: A meaningful comment on what the workflowTemplate is doing,`A template to send a Slack notification when a promotion start` in our case.
32-
1.**Resource Filename**: the name of the manifest file that will be saved under the`resources/control-planes/promotion-workflows`
33-
folder in your Shared Configuration Repository. LEave as-is for the quick-start.
31+
1.**Name**: A unique name for the Promotion Workflow,`slack-notification`
32+
for the quick start.
33+
1.**Description**: A meaningful comment on what the workflowTemplate is
34+
doing,`A template to send a Slack notification when a promotion start` in
35+
our case.
36+
1.**Resource Filename**: the name of the manifest file that will be saved
37+
under the`resources/control-planes/promotion-workflows`
38+
folder in your Shared Configuration Repository. Leave as-is for the
39+
quick-start.
40+
41+
{% include
42+
image.html
43+
lightbox="true"
44+
file="/images/quick-start/promotion-workflow/add-promotion-workflow.png"
45+
url="/images/quick-start/promotion-workflow/add-promotion-workflow.png"
46+
alt="Promotion workflow quick start: Create promotion workflow"
47+
caption="Promotion workflow quick start: Create promotion workflow"
48+
max-width="50%"
49+
%}
50+
51+
{:start="3"}
52+
1. Click**Add**.
53+
1. Select a**template**, for this quick-start, select the**start-manual-sync**
54+
1. Click**Next**
55+
1. Before we commit the file, we are going to do a few changes:
56+
1. Line 13: change the description to `This Workflow Template is an example for pre promotion workflow that
57+
send a slack message before the app is promoted`
58+
1. Line 18-21: change our developer info by your own.
59+
1. Line 33 & 35: change the name to`slack-promotion`
60+
1. Line 38: change description to`send a slack message before the app is promoted`
61+
1. Line 44-80: remove the 2 tasks`sync` and`wait`
62+
1. remote Line 54 (after above deletion). it is the`depends` one
63+
1. change template on line 47 to`post-to-channel`
64+
1. change the parameters to:
65+
```
66+
- name: SLACK_CHANNEL
67+
value: '<YOUR FAVORITE CHANNEL or email address for DM'
68+
- name: SLACK_MESSAGE
69+
value: 'Application `{{ workflow.parameters.APP_NAME }}` is ready to be promoted'
70+
- name: SLACK_TOKEN
71+
value: slack-token
72+
```
73+
**Notes**: `slack-token` is the name of the secret holding your Slack Token (in the `token` key)
74+
75+
Your Promotion Workflow should look something like:
76+
```
77+
#DO NOT REMOVE the following attributes:
78+
#annotations.codefresh.io/workflow-origin (identifies type of Workflow Template as Promotion Workflow)
79+
#annotations.version (identifies version of Promotion Workflow used)
80+
#annotations.description (identifies intended use of the Promotion Workflow)
81+
apiVersion: argoproj.io/v1alpha1
82+
kind: WorkflowTemplate
83+
metadata:
84+
name: slack-notification
85+
annotations:
86+
version: 0.0.1
87+
codefresh.io/workflow-origin: promotion
88+
argo-hub/version: 0.0.2
89+
argo-hub/description: >-
90+
This Workflow Template is an example for pre promotion workflow that send a
91+
slack message before the app is promoted
92+
argo-hub/categories: promotion example workflow
93+
argo-hub/license: MIT
94+
argo-hub/owner_name: Laurent Rochette
95+
argo-hub/owner_email:laurent.rochette@octopus.com
96+
argo-hub/owner_avatar:https://avatars.githubusercontent.com/u/2013371
97+
argo-hub/owner_url:https://github.com/lrochette
98+
argo-hub/icon_url: >-
99+
https://cdn.jsdelivr.net/gh/codefresh-io/argo-hub@main/examples/starter-manual-sync/assets/icon.svg
100+
argo-hub/icon_background: '#f4f4f4'
101+
description: A template to send a Slack notification when a promotion start
102+
spec:
103+
arguments:
104+
parameters:
105+
- name: APP_NAME
106+
- name: APP_NAMESPACE
107+
- name: SERVER_URL
108+
value: argo-cd-server.{{workflow.parameters.APP_NAMESPACE}}.svc.cluster.local
109+
entrypoint: slack-promotion
110+
templates:
111+
- name: slack-promotion
112+
metadata:
113+
annotations:
114+
argo-hub-template/description: send a slack message before the app is promoted
115+
argo-hub-template/icon_url: >-
116+
https://cdn.jsdelivr.net/gh/codefresh-io/argo-hub@main/examples/starter-manual-sync/assets/icon.svg
117+
argo-hub-template/icon_background: '#f4f4f4'
118+
dag:
119+
tasks:
120+
- name: send-message
121+
templateRef:
122+
name: argo-hub.slack.0.0.2
123+
template: send-message
124+
arguments:
125+
parameters:
126+
- name: SLACK_CHANNEL
127+
value:`laurent.rochette@octopus.com`
128+
- name: SLACK_TEXT
129+
value: 'Application`{{ workflow.parameters.APP_NAME }}` is ready to be promoted'
130+
- name: SLACK_TOKEN
131+
value: slack-token
132+
```
133+
{:start="7"}
134+
1. Click on **Commit**
135+
1. Feel free to add a **commit message**
136+
1. Click on **Commit**. It will take you back to the Promotion Workflows page.
137+
After a few minutes, the new Promotion Worflow should appear in the list
138+
34139
35140
## Related articles
36141
[Promotion Flow]({{site.baseurl}}/docs/promotions/promotion-flow/)
37142
[Promotion Workflow]({{site.baseurl}}/docs/promotions/promotion-workflow/)
38-
109 KB
Loading

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp