diff options
author | Marcel Amirault <mamirault@gitlab.com> | 2020-11-13 18:04:50 +0300 |
---|---|---|
committer | Achilleas Pipinellis <axil@gitlab.com> | 2020-11-13 18:04:50 +0300 |
commit | 8084afe2bac645aadf104568fc96c1ae1a3b0267 (patch) | |
tree | bf98f7c34aef932b4609ed72c916a15f2334eaeb | |
parent | 1495bb1e6aacd7389155ca48ecaddd221ea0efd7 (diff) |
Dedicate a lint image to just docs tests (vale/markdownlint/etc)
-rw-r--r-- | .gitlab-ci.yml | 22 | ||||
-rw-r--r-- | dockerfiles/Dockerfile.gitlab-docs-lint-markdown | 47 |
2 files changed, 69 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9df5a840..0aa6a761 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -438,6 +438,28 @@ image:docs-lint: environment: name: registry/docs-lint +image:docs-lint-markdown: + extends: + - .rules_scheduled + - .docker_prepare + stage: build-images + variables: + ALPINE_VERSION: '3.12' + VALE_VERSION: '2.6.1' + MARKDOWNLINT_VERSION: '0.24.0' + IMAGE_NAME: $CI_REGISTRY_IMAGE/lint-markdown:alpine-$ALPINE_VERSION-vale-$VALE_VERSION-markdownlint-$MARKDOWNLINT_VERSION + DOCKERFILE: dockerfiles/Dockerfile.gitlab-docs-lint-markdown + script: + - docker build + --build-arg ALPINE_VERSION=${ALPINE_VERSION} + --build-arg VALE_VERSION=${VALE_VERSION} + --build-arg MARKDOWNLINT_VERSION=${MARKDOWNLINT_VERSION} + --build-arg CI_COMMIT_REF_NAME=${CI_COMMIT_REF_NAME} + -t $IMAGE_NAME -f $DOCKERFILE . + - docker push $IMAGE_NAME + environment: + name: registry/docs-lint + # # GitLab docs image # diff --git a/dockerfiles/Dockerfile.gitlab-docs-lint-markdown b/dockerfiles/Dockerfile.gitlab-docs-lint-markdown new file mode 100644 index 00000000..29e4f6ba --- /dev/null +++ b/dockerfiles/Dockerfile.gitlab-docs-lint-markdown @@ -0,0 +1,47 @@ +############################ +# +# Image that contains the doc lint tools. +# +############################ + +# ALPINE_VERSION is defined in .gitlab-ci.yml +ARG ALPINE_VERSION + +FROM alpine:${ALPINE_VERSION} +MAINTAINER GitLab Technical Writing team + +# VALE_VERSION and MARKDOWNLINT_VERSION are defined in .gitlab-ci.yml +ARG VALE_VERSION +ARG MARKDOWNLINT_VERSION + +# Install dependencies +RUN apk add --no-cache -U \ + bash \ + build-base \ + curl \ + git \ + gnupg \ + grep \ + libc6-compat \ + libcurl \ + libxslt \ + libxslt-dev \ + nodejs \ + openssl \ + pngquant \ + tar \ + yarn + +# Install vale +RUN curl -sfL https://install.goreleaser.com/github.com/ValeLint/vale.sh | sh -s v${VALE_VERSION} + +# Set up needed environment variables that are called with --build-arg when +# the Docker image is built (see .gitlab-ci.yml). +ARG CI_COMMIT_REF_NAME +# If CI_COMMIT_REF_NAME is not set (local development), set it to master +ENV CI_COMMIT_REF_NAME ${CI_COMMIT_REF_NAME:-master} + +WORKDIR /tmp + +# markdownlint-cli pinned to control when new versions are put in place. +RUN yarn global add markdownlint-cli@${MARKDOWNLINT_VERSION} && yarn cache clean |