34 lines
1.9 KiB
YAML
34 lines
1.9 KiB
YAML
when:
|
|
# Manual-only — fired with IMAGE_TAG by the build pipeline (or
|
|
# by a human kicking off a deploy from the Woodpecker UI).
|
|
# The earlier `[manual, push]` would fire on every push and fail
|
|
# at check-vars because IMAGE_TAG is unset on push events.
|
|
- event: manual
|
|
|
|
steps:
|
|
- name: check-vars
|
|
image: alpine
|
|
commands:
|
|
- "[ -n \"$IMAGE_TAG\" ] || (echo 'IMAGE_TAG not set, skipping deploy'; exit 78)"
|
|
|
|
- name: deploy-cronjobs
|
|
image: bitnami/kubectl:latest
|
|
commands:
|
|
# broker-sync runs as CronJobs, not a Deployment. Update each CronJob's image
|
|
# so the next scheduled run picks it up. Running CronJob pods are untouched
|
|
# (Kubernetes doesn't do rolling updates on CronJob templates).
|
|
- "kubectl -n broker-sync set image cronjob/broker-sync-version broker-sync=viktorbarzin/broker-sync:${IMAGE_TAG}"
|
|
- "kubectl -n broker-sync set image cronjob/broker-sync-trading212 broker-sync=viktorbarzin/broker-sync:${IMAGE_TAG}"
|
|
- "kubectl -n broker-sync set image cronjob/broker-sync-imap broker-sync=viktorbarzin/broker-sync:${IMAGE_TAG}"
|
|
- "kubectl -n broker-sync set image cronjob/broker-sync-csv broker-sync=viktorbarzin/broker-sync:${IMAGE_TAG}"
|
|
- "kubectl -n broker-sync set image cronjob/broker-sync-fx-reconcile broker-sync=viktorbarzin/broker-sync:${IMAGE_TAG}"
|
|
|
|
- name: smoke-test
|
|
image: bitnami/kubectl:latest
|
|
commands:
|
|
# Spawn a one-shot Job from the version CronJob with the new image to prove
|
|
# the image is pullable and the CLI entrypoint works end-to-end.
|
|
- "kubectl -n broker-sync create job --from=cronjob/broker-sync-version broker-sync-smoke-${CI_COMMIT_SHA:0:8}"
|
|
- "kubectl -n broker-sync wait --for=condition=complete --timeout=300s job/broker-sync-smoke-${CI_COMMIT_SHA:0:8}"
|
|
- "kubectl -n broker-sync logs job/broker-sync-smoke-${CI_COMMIT_SHA:0:8}"
|
|
- "kubectl -n broker-sync delete job broker-sync-smoke-${CI_COMMIT_SHA:0:8}"
|