Skip to content

Commit b1ae912

Browse files
MuhanedYahyaEronWright
authored andcommitted
docs: make Stage context explicit in promotion step examples
Signed-off-by: Muhaned Yahya <muhaned.yahya@conevel.com>
1 parent 45616df commit b1ae912

5 files changed

Lines changed: 325 additions & 248 deletions

File tree

docs/docs/50-user-guide/60-reference-docs/30-promotion-steps/argocd-update.md

Lines changed: 123 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -177,23 +177,30 @@ or by a `Promotion` which failed to complete successfully.
177177
### Common Usage
178178

179179
```yaml
180-
steps:
181-
# Clone, render manifests, commit, push, etc...
182-
- uses: git-commit
183-
as: commit
184-
config:
185-
path: ./out
186-
message: ${{ outputs['update-image'].commitMessage }}
187-
- uses: git-push
188-
config:
189-
path: ./out
190-
- uses: argocd-update
191-
config:
192-
apps:
193-
- name: my-app
194-
sources:
195-
- repoURL: https://github.com/example/repo.git
196-
desiredRevision: ${{ outputs.commit.commit }}
180+
apiVersion: kargo.akuity.io/v1alpha1
181+
kind: Stage
182+
# ...
183+
spec:
184+
# ...
185+
promotionTemplate:
186+
spec:
187+
steps:
188+
# Clone, render manifests, commit, push, etc...
189+
- uses: git-commit
190+
as: commit
191+
config:
192+
path: ./out
193+
message: ${{ outputs['update-image'].commitMessage }}
194+
- uses: git-push
195+
config:
196+
path: ./out
197+
- uses: argocd-update
198+
config:
199+
apps:
200+
- name: my-app
201+
sources:
202+
- repoURL: https://github.com/example/repo.git
203+
desiredRevision: ${{ outputs.commit.commit }}
197204
```
198205

199206
### Updating a Target Revision
@@ -295,17 +302,25 @@ simple key-value label matching. All specified labels must match for an
295302
application to be selected.
296303

297304
```yaml
298-
steps:
299-
- uses: argocd-update
300-
config:
301-
apps:
302-
- selector:
303-
matchLabels:
304-
environment: production
305-
team: platform
306-
sources:
307-
- repoURL: https://github.com/example/repo.git
308-
desiredRevision: ${{ outputs.commit.commit }}
305+
apiVersion: kargo.akuity.io/v1alpha1
306+
kind: Stage
307+
# ...
308+
spec:
309+
# ...
310+
promotionTemplate:
311+
spec:
312+
steps:
313+
# Clone, render manifests, commit, push, etc...
314+
- uses: argocd-update
315+
config:
316+
apps:
317+
- selector:
318+
matchLabels:
319+
environment: production
320+
team: platform
321+
sources:
322+
- repoURL: https://github.com/example/repo.git
323+
desiredRevision: ${{ outputs.commit.commit }}
309324
```
310325

311326
This configuration will select all Argo CD `Application` resources in the
@@ -318,20 +333,28 @@ This example demonstrates using `matchExpressions` with the `In` operator to
318333
select `Application`s that match one of several possible values for a label.
319334

320335
```yaml
321-
steps:
322-
- uses: argocd-update
323-
config:
324-
apps:
325-
- selector:
326-
matchExpressions:
327-
- key: environment
328-
operator: In
329-
values:
330-
- staging
331-
- production
332-
sources:
333-
- repoURL: https://github.com/example/repo.git
334-
desiredRevision: ${{ outputs.commit.commit }}
336+
apiVersion: kargo.akuity.io/v1alpha1
337+
kind: Stage
338+
# ...
339+
spec:
340+
# ...
341+
promotionTemplate:
342+
spec:
343+
steps:
344+
# Clone, render manifests, commit, push, etc...
345+
- uses: argocd-update
346+
config:
347+
apps:
348+
- selector:
349+
matchExpressions:
350+
- key: environment
351+
operator: In
352+
values:
353+
- staging
354+
- production
355+
sources:
356+
- repoURL: https://github.com/example/repo.git
357+
desiredRevision: ${{ outputs.commit.commit }}
335358
```
336359

337360
This configuration will select all Argo CD `Application` resources that have
@@ -344,26 +367,34 @@ more precise selection criteria. All criteria must be satisfied for an
344367
application to be selected.
345368

346369
```yaml
347-
steps:
348-
- uses: argocd-update
349-
config:
350-
apps:
351-
- selector:
352-
matchLabels:
353-
team: platform
354-
matchExpressions:
355-
- key: environment
356-
operator: In
357-
values:
358-
- staging
359-
- production
360-
- key: managed-by
361-
operator: NotIn
362-
values:
363-
- legacy-system
364-
sources:
365-
- repoURL: https://github.com/example/repo.git
366-
desiredRevision: ${{ outputs.commit.commit }}
370+
apiVersion: kargo.akuity.io/v1alpha1
371+
kind: Stage
372+
# ...
373+
spec:
374+
# ...
375+
promotionTemplate:
376+
spec:
377+
steps:
378+
# Clone, render manifests, commit, push, etc...
379+
- uses: argocd-update
380+
config:
381+
apps:
382+
- selector:
383+
matchLabels:
384+
team: platform
385+
matchExpressions:
386+
- key: environment
387+
operator: In
388+
values:
389+
- staging
390+
- production
391+
- key: managed-by
392+
operator: NotIn
393+
values:
394+
- legacy-system
395+
sources:
396+
- repoURL: https://github.com/example/repo.git
397+
desiredRevision: ${{ outputs.commit.commit }}
367398
```
368399

369400
This configuration will select all Argo CD `Application` resources that:
@@ -402,29 +433,36 @@ environments in a single step. This is useful for rolling out changes to
402433
multiple stages simultaneously, such as in a blue/green deployment scenario.
403434

404435
```yaml
405-
vars:
406-
- name: gitRepo
407-
value: https://github.com/example/repo.git
408-
steps:
409-
# Clone, render manifests, commit, push, etc...
410-
- uses: git-commit
411-
as: commit
412-
config:
413-
path: ./out
414-
message: Update to new version
415-
- uses: git-push
416-
config:
417-
path: ./out
418-
- uses: argocd-update
419-
config:
420-
apps:
421-
- selector:
422-
matchLabels:
423-
app: my-microservice
424-
deployment-group: blue
425-
sources:
426-
- repoURL: ${{ vars.gitRepo }}
427-
desiredRevision: ${{ outputs.commit.commit }}
436+
apiVersion: kargo.akuity.io/v1alpha1
437+
kind: Stage
438+
# ...
439+
spec:
440+
# ...
441+
promotionTemplate:
442+
spec:
443+
vars:
444+
- name: gitRepo
445+
value: https://github.com/example/repo.git
446+
steps:
447+
# Clone, render manifests, commit, push, etc...
448+
- uses: git-commit
449+
as: commit
450+
config:
451+
path: ./out
452+
message: Update to new version
453+
- uses: git-push
454+
config:
455+
path: ./out
456+
- uses: argocd-update
457+
config:
458+
apps:
459+
- selector:
460+
matchLabels:
461+
app: my-microservice
462+
deployment-group: blue
463+
sources:
464+
- repoURL: ${{ vars.gitRepo }}
465+
desiredRevision: ${{ outputs.commit.commit }}
428466
```
429467

430468
This configuration will update all Argo CD `Application` resources that have

docs/docs/50-user-guide/60-reference-docs/30-promotion-steps/argocd-wait.md

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -90,27 +90,34 @@ to confirm that the `Application` has reached a healthy and synced state before
9090
the `Promotion` is marked as succeeded.
9191

9292
```yaml
93-
steps:
94-
# Clone, render manifests, commit, push, etc...
95-
- uses: git-commit
96-
as: commit
97-
config:
98-
path: ./out
99-
message: ${{ outputs['update-image'].commitMessage }}
100-
- uses: git-push
101-
config:
102-
path: ./out
103-
- uses: argocd-update
104-
config:
105-
apps:
106-
- name: my-app
107-
sources:
108-
- repoURL: https://github.com/example/repo.git
109-
desiredRevision: ${{ outputs.commit.commit }}
110-
- uses: argocd-wait
111-
config:
112-
apps:
113-
- name: my-app
93+
apiVersion: kargo.akuity.io/v1alpha1
94+
kind: Stage
95+
# ...
96+
spec:
97+
# ...
98+
promotionTemplate:
99+
spec:
100+
steps:
101+
# Clone, render manifests, commit, push, etc...
102+
- uses: git-commit
103+
as: commit
104+
config:
105+
path: ./out
106+
message: ${{ outputs['update-image'].commitMessage }}
107+
- uses: git-push
108+
config:
109+
path: ./out
110+
- uses: argocd-update
111+
config:
112+
apps:
113+
- name: my-app
114+
sources:
115+
- repoURL: https://github.com/example/repo.git
116+
desiredRevision: ${{ outputs.commit.commit }}
117+
- uses: argocd-wait
118+
config:
119+
apps:
120+
- name: my-app
114121
```
115122
116123
### Waiting Only for Operation Completion

0 commit comments

Comments
 (0)