diff options
| author | Erik Martin-Dorel | 2020-11-07 01:25:16 +0100 |
|---|---|---|
| committer | Erik Martin-Dorel | 2020-11-07 02:44:21 +0100 |
| commit | 8da589737cbb81889c26037eeed856f8a00ff667 (patch) | |
| tree | da7283ca24c744903df6d9ad486811717ae0150a /.gitlab-ci.yml | |
| parent | 8338973e2741baf7f9bbfd3bbcf5982c3963830c (diff) | |
fix: Deploy each image w.r.t. a separate GitLab CI environment name
to fully benefit from the "forward_deployment_failure" feature
cf. https://docs.gitlab.com/ee/ci/environments/deployment_safety.html#skip-outdated-deployment-jobs
Remark on environment names:
> Caution: Some characters are not allowed in environment names. Use
> only letters, numbers, spaces, and '-', '_', '/', '{', '}', or '.'.
> Also, it must not start nor end with '/'.
cf. https://docs.gitlab.com/ee/ci/environments/index.html
Diffstat (limited to '.gitlab-ci.yml')
| -rw-r--r-- | .gitlab-ci.yml | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 62b3eb6..7b7ae64 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,15 +1,15 @@ # Design: -# - build stage (e.g. docker build -t mathcomp-dev:$IID_$SLUG_coq-8.7 .) +# - build stage (e.g. docker build -t mathcomp-dev:$IID_$SLUG_coq-8.12 .) # - all branches (not tags) => push on GitLab registry # - GitHub PRs => push on GitLab and report back thanks to @coqbot # - test stage (image: mathcomp-dev:$IID_$SLUG_coq-8.7) # - script template foreach project (custom CONTRIB_URL, script) # - jobs foreach project and Coq version (custom COQ_VERSION, CONTRIB_VERSION) -# - deploy stage (only branch "master" and environment "deployment") +# - deploy stage (only branch "master" and environment deployments "mathcomp/*") # - pull each built image from GitLab registry => push to Docker Hub # + scheduled build & deploy for mathcomp/mathcomp-dev:coq-dev # -# Config for protected environment "deployment": +# Config for protected environment deployments "mathcomp/*": # - set vars HUB_REGISTRY, HUB_REGISTRY_USER, HUB_REGISTRY_IMAGE, HUB_TOKEN # # Remark: @@ -472,14 +472,15 @@ ci-fcsl-pcm-dev: services: - docker:dind environment: - name: deployment + # here, CI_JOB_NAME must not contain any ':', hence the use of '_' + name: "mathcomp/${CI_JOB_NAME}" url: https://hub.docker.com/r/mathcomp/mathcomp-dev variables: GIT_STRATEGY: none - HUB_IMAGE: "mathcomp/${CI_JOB_NAME}" IMAGE_PREFIX: "${CI_REGISTRY_IMAGE}:${CI_PIPELINE_IID}_${CI_COMMIT_REF_SLUG}" script: - - export IMAGE="${IMAGE_PREFIX}_${CI_JOB_NAME##*:}" + - export IMAGE="${IMAGE_PREFIX}_${CI_JOB_NAME##*_}" + - export HUB_IMAGE="mathcomp/${CI_JOB_NAME/_/:}" - echo "${IMAGE}" - docker pull "${IMAGE}" - echo "${HUB_IMAGE}" @@ -501,22 +502,22 @@ ci-fcsl-pcm-dev: variables: - $CRON_MODE == "nightly" -mathcomp-dev:coq-8.9: +mathcomp-dev_coq-8.9: extends: .docker-deploy-once -mathcomp-dev:coq-8.10: +mathcomp-dev_coq-8.10: extends: .docker-deploy-once -mathcomp-dev:coq-8.11: +mathcomp-dev_coq-8.11: extends: .docker-deploy-once -mathcomp-dev:coq-8.12: +mathcomp-dev_coq-8.12: extends: .docker-deploy-once # to uncomment when 8.13+alpha available -# mathcomp-dev:coq-8.13: +# mathcomp-dev_coq-8.13: # # to be replaced with .docker-deploy-once when 8.13.0 available # extends: .docker-deploy -mathcomp-dev:coq-dev: +mathcomp-dev_coq-dev: extends: .docker-deploy |
