diff options
-rw-r--r-- | .gitlab/ci/docker-images.gitlab-ci.yml | 43 | ||||
-rw-r--r-- | dockerfiles/gitlab-docs-base.Dockerfile | 41 |
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 95edeb752..643b98b1f 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 000000000..d9ea119d1 --- /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" |