The same changes as the Actions workflows: a release gate runs `task check dist` and the dist step only packages; canary and promote copy archied out of archied:edge instead of compiling it. The gate and the pull-request check keep Go's module, build and lint caches on the host, in separate directories so a pull request cannot write into the cache a release build reads. Fixes: notes wait for the signed release and carry the prerelease flag; the canary clones with tags, which its rollback needs to diff migrations; release puts HEAD on main before `task release`, which refuses anything else.
51 lines
2.1 KiB
YAML
51 lines
2.1 KiB
YAML
# Manual promotion: move stable to the release the canary is running, without
|
|
# waiting for its verdict. Same rules as the canary's own promotion, minus the
|
|
# window.
|
|
#
|
|
# Start it with the pipeline variable VERSION set to the release the canary
|
|
# runs (woodpecker-cli pipeline create --branch main --var VERSION=1.57.0).
|
|
#
|
|
# Requires repo secrets canary_url, canary_token and deploy_token.
|
|
|
|
when:
|
|
- event: [manual]
|
|
|
|
concurrency: 1
|
|
|
|
# Promotion reads the canary and the registry, never the repository.
|
|
skip_clone: true
|
|
|
|
steps:
|
|
- name: promote
|
|
image: docker:29-cli
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
environment:
|
|
DOCKER_HOST: unix:///var/run/docker.sock
|
|
CANARY_URL:
|
|
from_secret: canary_url
|
|
ARCHIE_CANARY_TOKEN:
|
|
from_secret: canary_token
|
|
DEPLOY_TOKEN:
|
|
from_secret: deploy_token
|
|
commands:
|
|
- '[ -n "$$VERSION" ] || { echo "VERSION is empty: start this workflow with the pipeline variable VERSION=<release the canary runs>"; exit 1; }'
|
|
- '[ -n "$$CANARY_URL" ] || { echo "repo secret canary_url is not set, so there is no canary to read"; exit 1; }'
|
|
- '[ -n "$$ARCHIE_CANARY_TOKEN" ] || { echo "repo secret canary_token is not set, so the canary cannot be reached"; exit 1; }'
|
|
- '[ -n "$$DEPLOY_TOKEN" ] || { echo "repo secret deploy_token is not set, so the registry cannot be tagged"; exit 1; }'
|
|
# archied reads the registry credentials this login writes.
|
|
- printf '%s' "$$DEPLOY_TOKEN" | docker login git.catlow.cloud -u "$$CI_REPO_OWNER" --password-stdin
|
|
# The deploy pipeline already built this binary. edge is the newest main
|
|
# that passed the gate.
|
|
- |
|
|
set -eu
|
|
image=git.catlow.cloud/sam/archied:edge
|
|
docker pull -q "$$image"
|
|
container=$(docker create "$$image")
|
|
docker cp "$$container:/usr/local/bin/archied" /tmp/archied
|
|
docker rm "$$container" >/dev/null
|
|
- >-
|
|
/tmp/archied release canary promote -dashboard "$$CANARY_URL"
|
|
-version "$$VERSION"
|
|
-latest git.catlow.cloud/sam/archied,git.catlow.cloud/sam/archie-agent
|