Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Amirault <mamirault@gitlab.com>2023-11-21 10:34:04 +0300
committerMarcel Amirault <mamirault@gitlab.com>2023-11-21 10:34:04 +0300
commit0ee3dd3dbf7714f460b1231433cebbce4411d10a (patch)
tree330cde0eb0b856724e4087a8edb1ac1452404ef1
parentd847ec0a4e7dddd61a0420daab0888a533a4bfad (diff)
parent540d5c7c214adb50ae7ec8e1326ef40c2fae0c55 (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.yml3
-rw-r--r--.gitlab/ci/test.gitlab-ci.yml18
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: