Skip to content

Commit d8a3225

Browse files
authored
Allow publishing images without (re-)running Sign stage (#2115)
1 parent fcd46a2 commit d8a3225

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

eng/docker-tools/DEV-GUIDE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,8 @@ When you queue a new run, you can override these as runtime parameters:
427427

428428
This avoids the multi-hour rebuild cycle when you just need to retry a failed operation.
429429

430+
When signing is enabled, use `"publish"` by itself only if the images from `sourceBuildPipelineRunId` were already signed and the current run is not building new images. Use `"sign,publish"` when the current run still needs to sign them before publishing.
431+
430432
---
431433

432434
## Troubleshooting

eng/docker-tools/templates/stages/publish.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ stages:
4747
# Run when all of the following are true:
4848
# 1. The pipeline has not been canceled.
4949
# 2. The stages variable includes 'publish'.
50-
# 3. Either signing is not enabled, or the Sign stage succeeded.
50+
# 3. Either signing is not enabled, this run is reusing previously signed images, or the Sign stage succeeded.
5151
# 4. Either the stages variable does not include 'build', or Post_Build succeeded.
5252
# 5. Either the stages variable does not include 'test', or Test succeeded/was skipped.
5353
condition: "
@@ -56,6 +56,10 @@ stages:
5656
contains(variables['stages'], 'publish'),
5757
or(
5858
ne(lower('${{ parameters.publishConfig.Signing.Enabled }}'), 'true'),
59+
and(
60+
not(contains(variables['stages'], 'build')),
61+
not(contains(variables['stages'], 'sign'))
62+
),
5963
in(dependencies.Sign.result, 'Succeeded', 'SucceededWithIssues')
6064
),
6165
or(

0 commit comments

Comments
 (0)