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>2022-12-15 17:00:24 +0300
committerMarcel Amirault <mamirault@gitlab.com>2022-12-15 17:00:24 +0300
commit6413ed6fbc353d0eb406e1e581b0eb1962615564 (patch)
treef244fcc70889a7fe802e99799915cfb45ef9a8d7
parentdc147fbc1b909e5f054ac2bfb598188a1b91d81e (diff)
parentc3ad8d2b7021981293e2e0c811f6735c5879695f (diff)
Merge branch 'axil-docker-base-back-from-the-dead' into 'main'
Bring back the base Docker image See merge request https://gitlab.com/gitlab-org/gitlab-docs/-/merge_requests/3368 Merged-by: Marcel Amirault <mamirault@gitlab.com> Approved-by: Marcel Amirault <mamirault@gitlab.com> Co-authored-by: Achilleas Pipinellis <axil@gitlab.com>
-rw-r--r--.gitlab/ci/docker-images.gitlab-ci.yml43
-rw-r--r--dockerfiles/gitlab-docs-base.Dockerfile41
2 files changed, 84 insertions, 0 deletions
diff --git a/.gitlab/ci/docker-images.gitlab-ci.yml b/.gitlab/ci/docker-images.gitlab-ci.yml
index 95edeb75..643b98b1 100644
--- a/.gitlab/ci/docker-images.gitlab-ci.yml
+++ b/.gitlab/ci/docker-images.gitlab-ci.yml
@@ -20,6 +20,49 @@
DOCKER_TLS_CERTDIR: "/certs"
#
+# Build and deploy the GitLab Docs base Docker image
+#
+image:gitlab-docs-base:
+ extends:
+ - .rules_scheduled_manual
+ - .docker_prepare
+ stage: build-images
+ variables:
+ IMAGE_NAME: $CI_REGISTRY_IMAGE/base:alpine-$ALPINE_VERSION-ruby-$RUBY_VERSION-$CI_COMMIT_SHORT_SHA
+ DOCKERFILE: dockerfiles/gitlab-docs-base.Dockerfile
+ script:
+ - docker build
+ --build-arg ALPINE_VERSION=${ALPINE_VERSION}
+ --build-arg RUBY_VERSION=${RUBY_VERSION}
+ --tag $IMAGE_NAME
+ --file $DOCKERFILE .
+ - docker push $IMAGE_NAME
+ environment:
+ name: registry/docs-base
+
+#
+# Test the GitLab docs base Docker image if changes are made to its Dockerfile
+#
+test:image:gitlab-docs-base:
+ extends:
+ - .docker_prepare
+ stage: test
+ needs: []
+ variables:
+ IMAGE_NAME: $CI_REGISTRY_IMAGE/base:alpine-$ALPINE_VERSION-ruby-$RUBY_VERSION-$CI_COMMIT_SHORT_SHA
+ DOCKERFILE: dockerfiles/gitlab-docs-base.Dockerfile
+ rules:
+ - if: $CI_PIPELINE_SOURCE == "merge_request_event"
+ changes:
+ - $DOCKERFILE
+ script:
+ - docker build
+ --build-arg ALPINE_VERSION=${ALPINE_VERSION}
+ --build-arg RUBY_VERSION=${RUBY_VERSION}
+ --tag $IMAGE_NAME
+ --file $DOCKERFILE .
+
+#
# Build and deploy the GitLab Docs linting (Markdown) Docker image
#
image:docs-lint-markdown:
diff --git a/dockerfiles/gitlab-docs-base.Dockerfile b/dockerfiles/gitlab-docs-base.Dockerfile
new file mode 100644
index 00000000..d9ea119d
--- /dev/null
+++ b/dockerfiles/gitlab-docs-base.Dockerfile
@@ -0,0 +1,41 @@
+#
+# Base image for other Docker images
+# Includes all system dependencies to build the GitLab Docs site
+#
+# RUBY_VERSION and ALPINE_VERSION are defined in ../.gitlab-ci.yml
+ARG RUBY_VERSION
+ARG ALPINE_VERSION
+
+FROM ruby:${RUBY_VERSION}-alpine${ALPINE_VERSION}
+
+# Install dependencies
+RUN printf "\n\e[32mINFO: Installing dependencies..\e[39m\n" && apk add --no-cache -U \
+ bash \
+ build-base \
+ curl \
+ gcompat \
+ git \
+ gnupg \
+ grep \
+ gzip \
+ jq \
+ libcurl \
+ libxslt \
+ libxslt-dev \
+ minify \
+ nodejs \
+ openssl \
+ pngquant \
+ ruby-dev \
+ tar \
+ xz \
+ xz-dev \
+ yarn \
+ && echo 'gem: --no-document' >> /etc/gemrc \
+ && gem update --silent --system \
+ && 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"