diff options
author | Marcel Amirault <mamirault@gitlab.com> | 2023-11-21 10:34:04 +0300 |
---|---|---|
committer | Marcel Amirault <mamirault@gitlab.com> | 2023-11-21 10:34:04 +0300 |
commit | 0ee3dd3dbf7714f460b1231433cebbce4411d10a (patch) | |
tree | 330cde0eb0b856724e4087a8edb1ac1452404ef1 | |
parent | d847ec0a4e7dddd61a0420daab0888a533a4bfad (diff) | |
parent | 540d5c7c214adb50ae7ec8e1326ef40c2fae0c55 (diff) |
Merge branch 'axil-dockerfile-check-template-backport-16.6' into '16.6'16.6
Check if single.Dockerfile is the same as the X.Y.Dockerfile
See merge request https://gitlab.com/gitlab-org/gitlab-docs/-/merge_requests/4409
Merged-by: Marcel Amirault <mamirault@gitlab.com>
Co-authored-by: Achilleas Pipinellis <axil@gitlab.com>
-rw-r--r-- | .gitlab-ci.yml | 3 | ||||
-rw-r--r-- | .gitlab/ci/test.gitlab-ci.yml | 18 |
2 files changed, 21 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bf346226..65d16271 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -68,3 +68,6 @@ workflow: - if: '$CI_COMMIT_BRANCH =~ /^\d{1,2}\.\d{1,2}$/' variables: DOCS_PROJECT_PIPELINE_TYPE: "Stable branch pipeline" + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME =~ /^\d{1,2}\.\d{1,2}$/' + variables: + DOCS_PROJECT_PIPELINE_TYPE: "MR pipeline (stable backport)" diff --git a/.gitlab/ci/test.gitlab-ci.yml b/.gitlab/ci/test.gitlab-ci.yml index 8f7fdf88..2afbd26e 100644 --- a/.gitlab/ci/test.gitlab-ci.yml +++ b/.gitlab/ci/test.gitlab-ci.yml @@ -70,6 +70,24 @@ check_asdf_installation: - .tool-versions # +# Check if single.Dockerfile is the same as the X.Y.Dockerfile. +# Their only difference should be the assignment of the ARG variable, +# so we can remove this from both files and diff the rest. +# Runs only on stable branches. +# +check_single_dockerfile_template: + image: busybox + needs: [] + stage: test + script: + - sed -i '/ARG VER/d' $CI_COMMIT_REF_NAME.Dockerfile dockerfiles/single.Dockerfile + - difference=$(diff $CI_COMMIT_REF_NAME.Dockerfile dockerfiles/single.Dockerfile) + - if [ -z $difference ]; then echo OK; else exit 1; fi + rules: + - if: '$DOCS_PROJECT_PIPELINE_TYPE == "MR pipeline (stable backport)"' + - if: '$DOCS_PROJECT_PIPELINE_TYPE == "Stable branch pipeline"' + +# # Run rspec tests # rspec: |