From 026e9fa6efeeae77af8cca4a6c02ec80afbb78b3 Mon Sep 17 00:00:00 2001 From: Tomasz Maczukin Date: Tue, 13 Aug 2019 08:59:26 +0200 Subject: [PATCH] Follow GitLab CI best practices This commit changes few things, implementing some of the GitLab CI known best practices: 1. Explicitly pointing the `docker:git` image to a specific version. Leaving the floating one we're risking that a buggy release of new Docker image will be randomly introduced to our pipelines. It's also best to make the Docker Client (used by the job from within the `docker:git` image) to be at the same version as the Docker Engine (running in the `docker:dind` service container). 2. Replacing `ci-job-token` with `CI_REGISTRY_USER` and `CI_JOB_TOKEN` with `CI_REGISTRY_PASSWORD` makes the script more bulletproff. Yes, at this moment these variables contain the same values. But they are dedicated for such usage and if GitLab CI will ever decide to switch how Registry access should be done, the dedicated variables will folow the proper way. --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b1873a3..4749981 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,11 +3,11 @@ include: - template: 'Workflows/MergeRequest-Pipelines.gitlab-ci.yml' default: - image: docker:git + image: docker:20.10.3-git services: - docker:20.10.3-dind before_script: - - docker login -u "gitlab-ci-token" -p "$CI_JOB_TOKEN" "$CI_REGISTRY" + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY" - source scripts/build-helpers.sh - apk add -U bash tags: