Skip to content

Rename CI_COMMIT_REF_NAME to VAR in image:docs-single job

Achilleas Pipinellis requested to merge axil-ci-single-ver into main

Closes #1632 (closed)

In the Dockerfile that builds the stable versions, we have the following variables defined:

ARG VER
ENV CI_COMMIT_REF_NAME=$VER

However, in the image:docs-single job, we never pass the VER variable in the --build-arg flags that are used to build the Docker image, thus CI_COMMIT_REF_NAME is never set, and we get a warning that it was not consumed.

This change replaces CI_COMMIT_REF_NAME with VER in the build argument. We actually do the same thing for image:docs-single-lunrjs.

This worked so far because when we cut the release each month, we set VAR to be the CI_COMMIT_REF_NAME. See for example the 15.10 Dockerfile.

I accidentally bumped into this when I tried to build the single Docker image locally by using the same build arguments as the CI job and using single.Dockerfile which doesn't have VER hardcoded (thus not defined at all). If VER is not set, then the post-process scripts that use this variable fail.

Verify locally

Unfortunately (or rather fortunately), we do define this in the test job, so you'll have to verify this locally.

  1. Build the Docker image with the previous change and see it fail when the post-process script runs.

    docker build --progress plain --build-arg NANOC_ENV=production --build-arg CI_COMMIT_REF_NAME=15.11 --build-arg SEARCH_BACKEND="google" --tag docs:15.11 --file dockerfiles/single.Dockerfile .
  2. Build it again with the change:

    docker build --progress plain --build-arg NANOC_ENV=production --build-arg VER=15.11 --build-arg SEARCH_BACKEND="google" --tag docs:15.11 --file dockerfiles/single.Dockerfile .
Edited by Achilleas Pipinellis

Merge request reports