2023-05-08 21:46:49 +05:30
---
default :
interruptible : true
stages :
- prepare
2023-05-27 22:25:52 +05:30
- deploy
2023-05-08 21:46:49 +05:30
include :
- local : .gitlab/ci/global.gitlab-ci.yml
release-environments-build-cng-env :
allow_failure : true
image : ${GITLAB_DEPENDENCY_PROXY_ADDRESS}ruby:${RUBY_VERSION}-alpine3.16
stage : prepare
needs :
# We need this job because we need its `cached-assets-hash.txt` artifact, so that we can pass the assets image tag to the downstream CNG pipeline.
- pipeline : $PARENT_PIPELINE_ID
job : build-assets-image
variables :
BUILD_ENV : build.env
before_script :
- source ./scripts/utils.sh
- install_gitlab_gem
script :
- 'ruby -r./scripts/trigger-build.rb -e "puts Trigger.variables_for_env_file(Trigger::CNG.new.variables)" > $BUILD_ENV'
- echo "GITLAB_ASSETS_TAG=$(assets_image_tag)" >> $BUILD_ENV
- ruby -e 'puts "FULL_RUBY_VERSION=#{RUBY_VERSION}"' >> build.env
- cat $BUILD_ENV
artifacts :
reports :
dotenv : $BUILD_ENV
paths :
- $BUILD_ENV
expire_in : 7 days
when : always
release-environments-build-cng :
allow_failure : true
stage : prepare
needs : [ "release-environments-build-cng-env" ]
inherit :
variables : false
variables :
GITLAB_REF_SLUG : "${GITLAB_REF_SLUG}"
# CNG pipeline specific variables
GITLAB_VERSION : "${GITLAB_VERSION}"
GITLAB_TAG : "${GITLAB_TAG}"
GITLAB_ASSETS_TAG : "${GITLAB_ASSETS_TAG}"
FORCE_RAILS_IMAGE_BUILDS : "${FORCE_RAILS_IMAGE_BUILDS}"
CE_PIPELINE : "${CE_PIPELINE}" # Based on https://docs.gitlab.com/ee/ci/jobs/job_control.html#check-if-a-variable-exists, `if: '$CE_PIPELINE'` will evaluate to `false` when this variable is empty
EE_PIPELINE : "${EE_PIPELINE}" # Based on https://docs.gitlab.com/ee/ci/jobs/job_control.html#check-if-a-variable-exists, `if: '$EE_PIPELINE'` will evaluate to `false` when this variable is empty
GITLAB_ELASTICSEARCH_INDEXER_VERSION : "${GITLAB_ELASTICSEARCH_INDEXER_VERSION}"
GITLAB_KAS_VERSION : "${GITLAB_KAS_VERSION}"
GITLAB_METRICS_EXPORTER_VERSION : "${GITLAB_METRICS_EXPORTER_VERSION}"
GITLAB_PAGES_VERSION : "${GITLAB_PAGES_VERSION}"
GITLAB_SHELL_VERSION : "${GITLAB_SHELL_VERSION}"
GITALY_SERVER_VERSION : "${GITALY_SERVER_VERSION}"
RUBY_VERSION : "${FULL_RUBY_VERSION}"
2023-05-27 22:25:52 +05:30
IMAGE_TAG_EXT : "-${CI_COMMIT_SHORT_SHA}"
2023-05-08 21:46:49 +05:30
trigger :
project : gitlab-org/build/CNG-mirror
branch : $TRIGGER_BRANCH
strategy : depend
2023-05-27 22:25:52 +05:30
release-environments-deploy-env :
allow_failure : true
stage : deploy
needs : [ "release-environments-build-cng" ]
variables :
DEPLOY_ENV : deploy.env
script :
- ./scripts/construct-release-environments-versions.rb > $DEPLOY_ENV
artifacts :
reports :
dotenv : $DEPLOY_ENV
paths :
- $DEPLOY_ENV
expire_in : 7 days
when : always
release-environments-deploy :
allow_failure : true
stage : deploy
needs : [ "release-environments-deploy-env" ]
inherit :
variables : false
variables :
VERSIONS : "${VERSIONS}"
ENVIRONMENT : "${ENVIRONMENT}"
trigger :
project : gitlab-com/gl-infra/release-environments
branch : main
strategy : depend