Add pipeline ID to docker image versions
Start better versioning of our docker images with the CI_PIPELINE_IID
variable. (See https://docs.gitlab.com/ee/ci/variables/predefined_variables.html)
I tested CI_COMMIT_TIMESTAMP
and CI_JOB_STARTED_AT
, but I felt that made a long name just too long. The output is in ISO8601 format, so it looks like: 2021-06-18T06:11:14Z
. That gives docker image names like:
registry.gitlab.com/gitlab-org/gitlab-docs/lint-markdown:alpine-3.13-vale-2.10.2-markdownlint-0.26.0-2021-06-18T06:11:14Z
Instead, we can use CI_PIPELINE_IID
that simply increments by one each time we run a new pipeline. So if we run the job back to back, the number just increments:
registry.gitlab.com/gitlab-org/gitlab-docs/lint-markdown:alpine-3.13-vale-2.10.2-markdownlint-ID-47411
registry.gitlab.com/gitlab-org/gitlab-docs/lint-markdown:alpine-3.13-vale-2.10.2-markdownlint-ID-47412
registry.gitlab.com/gitlab-org/gitlab-docs/lint-markdown:alpine-3.13-vale-2.10.2-markdownlint-ID-47413
(Yes, the latest pipeline IID is 47411
)