ci(gitlab-ci): add release stub; use GIT_STRATEGY none for frontend and backend downstreams
This commit is contained in:
parent
6214d08558
commit
5471a99475
@ -38,7 +38,6 @@ variables:
|
||||
stack.yaml.lock
|
||||
|
||||
|
||||
|
||||
default:
|
||||
image:
|
||||
name: ${CI_REGISTRY}/uniworx/containers/debian:12.5
|
||||
@ -56,7 +55,7 @@ stages:
|
||||
- setup
|
||||
- frontend
|
||||
- backend
|
||||
- release # TODO
|
||||
- release
|
||||
|
||||
|
||||
setup:dynamic:
|
||||
@ -118,8 +117,11 @@ setup:containers:backend:manual:
|
||||
- when: manual
|
||||
allow_failure: true
|
||||
|
||||
|
||||
frontend:
|
||||
stage: frontend
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
needs:
|
||||
- setup:dynamic
|
||||
- job: setup:containers:frontend
|
||||
@ -130,8 +132,11 @@ frontend:
|
||||
- artifact: frontend.yml
|
||||
job: setup:dynamic
|
||||
|
||||
|
||||
backend:dev: &backend
|
||||
stage: backend
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
needs:
|
||||
- setup:dynamic
|
||||
- job: setup:containers:backend
|
||||
@ -149,6 +154,69 @@ backend:prod:
|
||||
PROD_BUILD: -prod
|
||||
|
||||
|
||||
release:prepare:
|
||||
stage: release
|
||||
script:
|
||||
- echo "Preparing release..."
|
||||
# TODO: get tag and pass to following release jobs as artifact
|
||||
rules: &release-rules #TODO: only start job for tags v$MAJOR.$MINOR.$SUBMINOR, t$MAJOR.$MINOR.$SUBMINOR, and d$MAJOR.$MINOR.$SUBMINOR
|
||||
- when: manual
|
||||
|
||||
release:changelog:
|
||||
stage: release
|
||||
script:
|
||||
- xzcat node-dependencies.nar.xz | nix-store --import
|
||||
- nix -L run ".#jqChangelogJson" -- -r '.versions[0].version' > .current-version
|
||||
- nix -L run ".#jqChangelogJson" -- -r '.versions[0].body' > .current-changelog.md
|
||||
- echo "VERSION=$(cat .current-version)" >> build.env
|
||||
artifacts:
|
||||
reports:
|
||||
dotenv: build.env
|
||||
paths:
|
||||
- .current-version
|
||||
- .current-changelog.md
|
||||
name: "changelog-${CI_COMMIT_SHORT_SHA}"
|
||||
expire_in: "1 day"
|
||||
|
||||
release:container:
|
||||
stage: release
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
image: ${IMAGE_BUILDER}
|
||||
script:
|
||||
- echo "Building container for release ${RELEASE}..."
|
||||
- buildah bud
|
||||
- echo "Pushing container ${RELEASE} to container registry..."
|
||||
- buildah push
|
||||
# - skopeo --insecure-policy copy --dest-creds "${CI_REGISTRY_USER}:${CI_JOB_TOKEN}" docker-archive://$(pwd)/uniworx.tar.gz docker://${CI_REGISTRY_IMAGE}:${VERSION}
|
||||
# - skopeo --insecure-policy copy --src-creds "${CI_REGISTRY_USER}:${CI_JOB_TOKEN}" --dest-creds "${CI_REGISTRY_USER}:${CI_JOB_TOKEN}" docker://${CI_REGISTRY_IMAGE}:${VERSION} docker://${CI_REGISTRY_IMAGE}:latest
|
||||
needs:
|
||||
- frontend # sanity
|
||||
- backend # sanity
|
||||
- release:changelog
|
||||
rules: *release-rules
|
||||
|
||||
release:release:
|
||||
stage: release
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
||||
rules: *release-rules
|
||||
script:
|
||||
- echo "Creating release ${VERSION}"
|
||||
release:
|
||||
name: "${VERSION}"
|
||||
tag_name: '$CI_COMMIT_TAG'
|
||||
description: .current-changelog.md
|
||||
needs:
|
||||
- frontend # sanity
|
||||
- backend # sanity
|
||||
- release:container
|
||||
- release:changelog
|
||||
retry: 0
|
||||
|
||||
|
||||
|
||||
# frontend dependencies:
|
||||
# stage: setup
|
||||
# cache:
|
||||
|
||||
Reference in New Issue
Block a user