diff --git a/.woodpecker/publish.yml b/.woodpecker/publish.yml index f75e64b5..f4e99282 100644 --- a/.woodpecker/publish.yml +++ b/.woodpecker/publish.yml @@ -32,6 +32,11 @@ variables: # non-excluded change still builds, so no transitive dep can silently go stale. # (Woodpecker: `when` entries are OR'd; `path` applies to push/PR only — hence # the separate `event: tag` entry.) + # #1407: ONE shared anchor for all three image steps. A second main-only + # anchor previously gated build-web/build-appservice, so next-lane pushes + # published gateway sha images with no web/appservice counterpart — no + # sha-parity set existed for next-lane containerized deploys. Every image + # step now builds on next too (sha-only destinations, enforced per step). - &image_build_when - event: tag - event: [push, manual] @@ -44,16 +49,6 @@ variables: - '.woodpecker/**' - event: [push, manual] branch: next - - &main_image_build_when - - event: tag - - event: [push, manual] - branch: main - path: - exclude: - - 'packages/mosaic/**' - - 'docs/**' - - '**/*.md' - - '.woodpecker/**' when: - branch: [main, next] @@ -474,7 +469,7 @@ steps: build-appservice: image: gcr.io/kaniko-project/executor:debug - when: *main_image_build_when + when: *image_build_when environment: REGISTRY_USER: from_secret: REGISTRY_USERNAME @@ -488,8 +483,17 @@ steps: - echo "{\"auths\":{\"git.mosaicstack.dev\":{\"username\":\"$REGISTRY_USER\",\"password\":\"$REGISTRY_PASS\"}}}" > /kaniko/.docker/config.json - | DESTINATIONS="--destination git.mosaicstack.dev/mosaicstack/stack/appservice:sha-${CI_COMMIT_SHA:0:7}" - if [ "$CI_COMMIT_BRANCH" = "main" ]; then + if [ "$CI_COMMIT_BRANCH" = "next" ]; then + if [ -n "$CI_COMMIT_TAG" ]; then + echo "[publish] FATAL: next appservice publish must be sha-only; refusing tag '$CI_COMMIT_TAG'" >&2 + exit 1 + fi + echo "[publish] next appservice publish is sha-only" + elif [ "$CI_COMMIT_BRANCH" = "main" ]; then DESTINATIONS="$DESTINATIONS --destination git.mosaicstack.dev/mosaicstack/stack/appservice:latest" + elif [ -z "$CI_COMMIT_TAG" ]; then + echo "[publish] FATAL: appservice image publish may only run for main, next, or tag events" >&2 + exit 1 fi if [ -n "$CI_COMMIT_TAG" ]; then DESTINATIONS="$DESTINATIONS --destination git.mosaicstack.dev/mosaicstack/stack/appservice:$CI_COMMIT_TAG" @@ -509,7 +513,7 @@ steps: build-web: image: gcr.io/kaniko-project/executor:debug - when: *main_image_build_when + when: *image_build_when environment: REGISTRY_USER: from_secret: REGISTRY_USERNAME @@ -523,8 +527,17 @@ steps: - echo "{\"auths\":{\"git.mosaicstack.dev\":{\"username\":\"$REGISTRY_USER\",\"password\":\"$REGISTRY_PASS\"}}}" > /kaniko/.docker/config.json - | DESTINATIONS="--destination git.mosaicstack.dev/mosaicstack/stack/web:sha-${CI_COMMIT_SHA:0:7}" - if [ "$CI_COMMIT_BRANCH" = "main" ]; then + if [ "$CI_COMMIT_BRANCH" = "next" ]; then + if [ -n "$CI_COMMIT_TAG" ]; then + echo "[publish] FATAL: next web publish must be sha-only; refusing tag '$CI_COMMIT_TAG'" >&2 + exit 1 + fi + echo "[publish] next web publish is sha-only" + elif [ "$CI_COMMIT_BRANCH" = "main" ]; then DESTINATIONS="$DESTINATIONS --destination git.mosaicstack.dev/mosaicstack/stack/web:latest" + elif [ -z "$CI_COMMIT_TAG" ]; then + echo "[publish] FATAL: web image publish may only run for main, next, or tag events" >&2 + exit 1 fi if [ -n "$CI_COMMIT_TAG" ]; then DESTINATIONS="$DESTINATIONS --destination git.mosaicstack.dev/mosaicstack/stack/web:$CI_COMMIT_TAG"