87 lines
2.3 KiB
YAML
87 lines
2.3 KiB
YAML
# Environments
|
|
# RUN_PHASES=build-image|publish-quay|publish-ghcr|publish-ecr - execute workflow phases
|
|
# CI_MANUAL_TAG=0.0.1 - application release version, gets priority over CI_COMMIT_TAG
|
|
|
|
variables:
|
|
- &debian_image 'public.ecr.aws/docker/library/debian:bookworm-slim'
|
|
- &kaniko_image "gcr.io/kaniko-project/executor:v1.24.0-debug"
|
|
- &skopeo_image "public.ecr.aws/flakybitnet/skopeo:1.19.0-fb1"
|
|
|
|
when:
|
|
- branch: main
|
|
event:
|
|
- manual
|
|
- branch:
|
|
exclude: main
|
|
event:
|
|
- manual
|
|
- push
|
|
- tag
|
|
|
|
steps:
|
|
# prepare
|
|
set-env:
|
|
image: *debian_image
|
|
commands:
|
|
- .ci/set-env.sh
|
|
get-dist:
|
|
when:
|
|
evaluate: 'RUN_PHASES == "" || "build-image" in split(RUN_PHASES, ",")'
|
|
image: *debian_image
|
|
commands:
|
|
- .ci/get-dist.sh
|
|
prepare-rootfs:
|
|
when:
|
|
evaluate: 'RUN_PHASES == "" || "build-image" in split(RUN_PHASES, ",")'
|
|
image: *debian_image
|
|
commands:
|
|
- .ci/prepare-rootfs.sh
|
|
|
|
# image
|
|
image:
|
|
when:
|
|
evaluate: 'RUN_PHASES == "" || "build-image" in split(RUN_PHASES, ",")'
|
|
image: *kaniko_image
|
|
environment:
|
|
HARBOR_CREDS:
|
|
from_secret: fb_harbor_creds
|
|
commands:
|
|
- .ci/image.sh
|
|
|
|
# publish external
|
|
publish-quay:
|
|
when:
|
|
evaluate: '(RUN_PHASES == "" || "publish-quay" in split(RUN_PHASES, ",")) && (CI_COMMIT_TAG != "" || CI_MANUAL_TAG != "")'
|
|
failure: ignore
|
|
image: *skopeo_image
|
|
environment:
|
|
DEST_REGISTRY: quay.io
|
|
DEST_CREDS:
|
|
from_secret: fb_quay_creds
|
|
commands:
|
|
- .ci/publish-external.sh
|
|
publish-ghcr:
|
|
when:
|
|
evaluate: '(RUN_PHASES == "" || "publish-ghcr" in split(RUN_PHASES, ",")) && (CI_COMMIT_TAG != "" || CI_MANUAL_TAG != "")'
|
|
failure: ignore
|
|
image: *skopeo_image
|
|
environment:
|
|
DEST_REGISTRY: ghcr.io
|
|
DEST_CREDS:
|
|
from_secret: fb_ghcr_creds
|
|
commands:
|
|
- .ci/publish-external.sh
|
|
publish-ecr:
|
|
when:
|
|
evaluate: '(RUN_PHASES == "" || "publish-ecr" in split(RUN_PHASES, ",")) && (CI_COMMIT_TAG != "" || CI_MANUAL_TAG != "")'
|
|
failure: ignore
|
|
environment:
|
|
DEST_REGISTRY: public.ecr.aws
|
|
AWS_ACCESS_KEY_ID:
|
|
from_secret: fb_ecr_key_id
|
|
AWS_SECRET_ACCESS_KEY:
|
|
from_secret: fb_ecr_key
|
|
image: *skopeo_image
|
|
commands:
|
|
- .ci/publish-external.sh
|