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:
authorEvan Read <eread@gitlab.com>2022-06-01 04:12:23 +0300
committerEvan Read <eread@gitlab.com>2022-06-02 02:02:18 +0300
commit1fefeac1003595ade19e7011197c49c9fc372d14 (patch)
tree0f2ee9fdc2e3122d01232014b32804b893f385cb
parent2ae651bfe31d4b9c366528fc93b9963c56bf270c (diff)
Test single.Dockerfile changeseread/test-single_dockerfile-changes
-rw-r--r--.gitlab-ci.yml26
-rw-r--r--dockerfiles/single.Dockerfile16
2 files changed, 37 insertions, 5 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 7ef79bb8..573c2c68 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -771,6 +771,32 @@ image:docs-single:
- if: '$CI_COMMIT_BRANCH =~ /^\d{1,2}\.\d{1,2}$/'
#
+# Test the GitLab docs single version Docker image if changes made to its Dockerfile
+#
+test:image:docs-single:
+ extends:
+ - .docker_prepare
+ stage: test
+ variables:
+ DOCKERFILE: dockerfiles/single.Dockerfile
+ MAJOR_VERSION_GITLAB: '15'
+ MINOR_VERSION_GITLAB: '0'
+ MAJOR_VERSION_CHARTS: '6'
+ MINOR_VERSION_CHARTS: '0'
+ needs: []
+ rules:
+ - if: $CI_PIPELINE_SOURCE == "merge_request_event"
+ changes:
+ - $DOCKERFILE
+ script:
+ # Update template with version numbers
+ - sed -i "s/X\.Y/${MAJOR_VERSION_GITLAB}\.${MINOR_VERSION_GITLAB}/" $DOCKERFILE
+ - sed -i "s/X-Y/${MAJOR_VERSION_GITLAB}-${MINOR_VERSION_GITLAB}/" $DOCKERFILE
+ - sed -i "s/W-Z/${MAJOR_VERSION_CHARTS}-${MINOR_VERSION_CHARTS}/" $DOCKERFILE
+ # Build the image
+ - docker build --file $DOCKERFILE .
+
+#
# Build master containing the online archives and latest docs (on schedules)
#
image:docs-latest:
diff --git a/dockerfiles/single.Dockerfile b/dockerfiles/single.Dockerfile
index f53bcaf7..2bca83e2 100644
--- a/dockerfiles/single.Dockerfile
+++ b/dockerfiles/single.Dockerfile
@@ -63,7 +63,13 @@ RUN apk add --no-cache -U \
xz-dev \
yarn \
&& echo 'gem: --no-document' >> /etc/gemrc \
- && gem update --system 3.3.13
+ && gem update --silent --system 3.3.13 \
+ && printf "\n\e[32mINFO: Dependency versions:\e[39m\n" \
+ && echo "Ruby: $(ruby --version)" \
+ && echo "RubyGems: $(gem --version)" \
+ && echo "Node.js: $(node --version)" \
+ && echo "Yarn: $(yarn --version)" \
+ && printf "\n"
# Build the docs from this branch
COPY . /source/
@@ -78,12 +84,12 @@ RUN yarn install --frozen-lockfile \
# Move generated HTML to /site
RUN mkdir /site \
- && mv public /site/${VER}
+ && mv public "/site/${VER}"
# Do some HTML post-processing on the archive, compress images, and minify assets
-RUN /source/scripts/normalize-links.sh /site ${VER} \
- && /source/scripts/compress_images.sh /site ${VER} \
- && /source/scripts/minify-assets.sh /site ${VER} # ATTENTION: This should be the last script to run
+RUN /source/scripts/normalize-links.sh /site "${VER}" \
+ && /source/scripts/compress_images.sh /site "${VER}" \
+ && /source/scripts/minify-assets.sh /site "${VER}" # ATTENTION: This should be the last script to run
# Make an index.html and 404.html which will redirect / to /${VER}/
RUN echo "<html><head><title>Redirect for ${VER}</title><meta http-equiv=\"refresh\" content=\"0;url='/${VER}/'\" /></head><body><p>If you are not redirected automatically, click <a href=\"/${VER}/\">here</a>.</p></body></html>" > /site/index.html \