Skip to content

Commit 37037b9

Browse files
docs: point PromotionTask users to task.outputs in examples
Builds on the explicit Stage context by folding in the approach from #6284: each promotion-step example that references a previous step's outputs now also carries an inline "# Or task.outputs in a (Cluster)PromotionTask" pointer, and the remaining reference pages that use step outputs (gha-wait-for-workflow, git-commit, jfrog-evidence, jira, oci-push, send-message) are wrapped in the same Stage context. Where an output reference sits inside a multi-line ${{ quote({...}) }} expression, the inline pointer is omitted (it would break the expression); the Stage context alone disambiguates there. Also fixes a "Promoteing" typo in the jira example. Closes #6275 Co-authored-by: Andres <aguido@unal.edu.co> Signed-off-by: Eron Wright <eron.wright@akuity.io>
1 parent b1ae912 commit 37037b9

11 files changed

Lines changed: 353 additions & 262 deletions

File tree

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ spec:
190190
as: commit
191191
config:
192192
path: ./out
193-
message: ${{ outputs['update-image'].commitMessage }}
193+
message: ${{ outputs['update-image'].commitMessage }} # Or task.outputs in a (Cluster)PromotionTask
194194
- uses: git-push
195195
config:
196196
path: ./out
@@ -320,7 +320,7 @@ spec:
320320
team: platform
321321
sources:
322322
- repoURL: https://github.com/example/repo.git
323-
desiredRevision: ${{ outputs.commit.commit }}
323+
desiredRevision: ${{ outputs.commit.commit }} # Or task.outputs in a (Cluster)PromotionTask
324324
```
325325

326326
This configuration will select all Argo CD `Application` resources in the
@@ -354,7 +354,7 @@ spec:
354354
- production
355355
sources:
356356
- repoURL: https://github.com/example/repo.git
357-
desiredRevision: ${{ outputs.commit.commit }}
357+
desiredRevision: ${{ outputs.commit.commit }} # Or task.outputs in a (Cluster)PromotionTask
358358
```
359359

360360
This configuration will select all Argo CD `Application` resources that have
@@ -394,7 +394,7 @@ spec:
394394
- legacy-system
395395
sources:
396396
- repoURL: https://github.com/example/repo.git
397-
desiredRevision: ${{ outputs.commit.commit }}
397+
desiredRevision: ${{ outputs.commit.commit }} # Or task.outputs in a (Cluster)PromotionTask
398398
```
399399

400400
This configuration will select all Argo CD `Application` resources that:
@@ -462,7 +462,7 @@ spec:
462462
deployment-group: blue
463463
sources:
464464
- repoURL: ${{ vars.gitRepo }}
465-
desiredRevision: ${{ outputs.commit.commit }}
465+
desiredRevision: ${{ outputs.commit.commit }} # Or task.outputs in a (Cluster)PromotionTask
466466
```
467467

468468
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ spec:
103103
as: commit
104104
config:
105105
path: ./out
106-
message: ${{ outputs['update-image'].commitMessage }}
106+
message: ${{ outputs['update-image'].commitMessage }} # Or task.outputs in a (Cluster)PromotionTask
107107
- uses: git-push
108108
config:
109109
path: ./out

docs/docs/50-user-guide/60-reference-docs/30-promotion-steps/gha-wait-for-workflow.md

Lines changed: 57 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -124,54 +124,75 @@ Valid values for `expectedConclusion`:
124124
This example waits for a previously dispatched workflow to complete successfully using the new configuration format.
125125

126126
```yaml
127-
steps:
128-
- uses: gha-wait-for-workflow
129-
config:
130-
repoURL: https://github.com/myorg/my-app
131-
runID: "${{ outputs['dispatch-deployment'].runID }}"
132-
expectedConclusion: success
133-
insecureSkipTLSVerify: false
127+
apiVersion: kargo.akuity.io/v1alpha1
128+
kind: Stage
129+
# ...
130+
spec:
131+
# ...
132+
promotionTemplate:
133+
spec:
134+
steps:
135+
- uses: gha-wait-for-workflow
136+
config:
137+
repoURL: https://github.com/myorg/my-app
138+
runID: "${{ outputs['dispatch-deployment'].runID }}" # Or task.outputs in a (Cluster)PromotionTask
139+
expectedConclusion: success
140+
insecureSkipTLSVerify: false
134141
```
135142
136143
### v1.8 (Deprecated)
137144
138145
```yaml
139-
steps:
140-
- uses: gha-wait-for-workflow
141-
config:
142-
credentials:
143-
secretName: github-credentials
144-
owner: myorg
145-
repo: my-app
146-
runID: "${{ outputs['dispatch-deployment'].runID }}"
147-
expectedConclusion: success
146+
apiVersion: kargo.akuity.io/v1alpha1
147+
kind: Stage
148+
# ...
149+
spec:
150+
# ...
151+
promotionTemplate:
152+
spec:
153+
steps:
154+
- uses: gha-wait-for-workflow
155+
config:
156+
credentials:
157+
secretName: github-credentials
158+
owner: myorg
159+
repo: my-app
160+
runID: "${{ outputs['dispatch-deployment'].runID }}" # Or task.outputs in a (Cluster)PromotionTask
161+
expectedConclusion: success
148162
```
149163
150164
## Multi-Step Workflow Example
151165
152166
This example shows how to combine `gha-dispatch-workflow` and `gha-wait-for-workflow` steps using the new configuration format:
153167

154168
```yaml
155-
steps:
156-
# Dispatch the workflow
157-
- uses: gha-dispatch-workflow
158-
as: dispatch-deployment
159-
config:
160-
repoURL: https://github.com/example/test
161-
workflowFile: test.yaml
162-
ref: master
163-
inputs:
164-
greeting: "hola"
165-
timeout: 120
166-
167-
# Wait for the workflow to complete
168-
- uses: gha-wait-for-workflow
169-
config:
170-
repoURL: https://github.com/example/test
171-
runID: "${{ outputs['dispatch-deployment'].runID }}"
172-
expectedConclusion: success
173-
174-
# Continue with other promotion steps after workflow completes...
169+
apiVersion: kargo.akuity.io/v1alpha1
170+
kind: Stage
171+
# ...
172+
spec:
173+
# ...
174+
promotionTemplate:
175+
spec:
176+
steps:
177+
# Dispatch the workflow
178+
- uses: gha-dispatch-workflow
179+
as: dispatch-deployment
180+
config:
181+
repoURL: https://github.com/example/test
182+
workflowFile: test.yaml
183+
ref: master
184+
inputs:
185+
greeting: "hola"
186+
timeout: 120
187+
188+
# Wait for the workflow to complete
189+
- uses: gha-wait-for-workflow
190+
config:
191+
repoURL: https://github.com/example/test
192+
runID: "${{ outputs['dispatch-deployment'].runID }}" # Or task.outputs in a (Cluster)PromotionTask
193+
expectedConclusion: success
194+
195+
# Continue with other promotion steps after workflow completes...
175196
```
176197

177198
## Migration from v1.8 to v1.9

docs/docs/50-user-guide/60-reference-docs/30-promotion-steps/git-commit.md

Lines changed: 51 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -44,36 +44,43 @@ with a message from the [`kustomize-set-image` step](kustomize-set-image.md) tha
4444
updated the `kustomization.yaml` file, summarizing the changes made.
4545

4646
```yaml
47-
vars:
48-
- name: gitRepo
49-
value: https://github.com/example/repo.git
50-
steps:
51-
- uses: git-clone
52-
config:
53-
repoURL: ${{ vars.gitRepo }}
54-
checkout:
55-
- commit: ${{ commitFrom(vars.gitRepo).ID }}
56-
path: ./src
57-
- branch: stage/${{ ctx.stage }}
58-
create: true
59-
path: ./out
60-
- uses: git-clear
61-
config:
62-
path: ./out
63-
- uses: kustomize-set-image
64-
as: update-image
65-
config:
66-
images:
67-
- image: my/image
68-
- uses: kustomize-build
69-
config:
70-
path: ./src/stages/${{ ctx.stage }}
71-
outPath: ./out
72-
- uses: git-commit
73-
config:
74-
path: ./out
75-
message: ${{ outputs['update-image'].commitMessage }}
76-
# Push, etc...
47+
apiVersion: kargo.akuity.io/v1alpha1
48+
kind: Stage
49+
# ...
50+
spec:
51+
# ...
52+
promotionTemplate:
53+
spec:
54+
vars:
55+
- name: gitRepo
56+
value: https://github.com/example/repo.git
57+
steps:
58+
- uses: git-clone
59+
config:
60+
repoURL: ${{ vars.gitRepo }}
61+
checkout:
62+
- commit: ${{ commitFrom(vars.gitRepo).ID }}
63+
path: ./src
64+
- branch: stage/${{ ctx.stage }}
65+
create: true
66+
path: ./out
67+
- uses: git-clear
68+
config:
69+
path: ./out
70+
- uses: kustomize-set-image
71+
as: update-image
72+
config:
73+
images:
74+
- image: my/image
75+
- uses: kustomize-build
76+
config:
77+
path: ./src/stages/${{ ctx.stage }}
78+
outPath: ./out
79+
- uses: git-commit
80+
config:
81+
path: ./out
82+
message: ${{ outputs['update-image'].commitMessage }} # Or task.outputs in a (Cluster)PromotionTask
83+
# Push, etc...
7784
```
7885

7986
### Composed Commit Message
@@ -94,11 +101,18 @@ commit messages when several changes are being committed together.
94101
:::
95102

96103
```yaml
97-
steps:
98-
# Update Kustomize manifests, etc...
99-
- uses: git-commit
100-
config:
101-
path: ./out
102-
message: |
103-
${{ ctx.stage }}: ${{ outputs['update-image'].commitMessage }}
104+
apiVersion: kargo.akuity.io/v1alpha1
105+
kind: Stage
106+
# ...
107+
spec:
108+
# ...
109+
promotionTemplate:
110+
spec:
111+
steps:
112+
# Update Kustomize manifests, etc...
113+
- uses: git-commit
114+
config:
115+
path: ./out
116+
message: |
117+
${{ ctx.stage }}: ${{ outputs['update-image'].commitMessage }} # Or task.outputs in a (Cluster)PromotionTask
104118
```

docs/docs/50-user-guide/60-reference-docs/30-promotion-steps/git-open-pr.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ spec:
8888
as: open-pr
8989
config:
9090
repoURL: https://github.com/example/repo.git
91-
sourceBranch: ${{ outputs.push.branch }}
91+
sourceBranch: ${{ outputs.push.branch }} # Or task.outputs in a (Cluster)PromotionTask
9292
targetBranch: stage/${{ ctx.stage }}
9393
# Wait for the PR to be merged or closed...
9494
```
@@ -124,7 +124,7 @@ spec:
124124
as: open-pr
125125
config:
126126
repoURL: https://github.com/example/repo.git
127-
sourceBranch: ${{ outputs.push.branch }}
127+
sourceBranch: ${{ outputs.push.branch }} # Or task.outputs in a (Cluster)PromotionTask
128128
targetBranch: stage/${{ ctx.stage }}
129129
title: Deploy to ${{ ctx.stage }}
130130
labels: ["infra", "needs-review"]
@@ -163,7 +163,7 @@ spec:
163163
as: open-pr
164164
config:
165165
repoURL: https://github.com/example/repo.git
166-
sourceBranch: ${{ outputs.push.branch }}
166+
sourceBranch: ${{ outputs.push.branch }} # Or task.outputs in a (Cluster)PromotionTask
167167
targetBranch: stage/${{ ctx.stage }}
168168
- if: ${{ status('open-pr') != 'Skipped' }}
169169
uses: git-wait-for-pr

docs/docs/50-user-guide/60-reference-docs/30-promotion-steps/git-wait-for-pr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ spec:
8585
config:
8686
repoURL: https://github.com/example/repo.git
8787
createTargetBranch: true
88-
sourceBranch: ${{ outputs.push.branch }}
88+
sourceBranch: ${{ outputs.push.branch }} # Or task.outputs in a (Cluster)PromotionTask
8989
targetBranch: stage/${{ ctx.stage }}
9090
- uses: git-wait-for-pr
9191
as: wait-for-pr

0 commit comments

Comments
 (0)