From 8426af618c16652b27f6f29766167a8f4360a048 Mon Sep 17 00:00:00 2001 From: "Guillaume \"B.B.\" Van Hemmen" <458819-GuillaumeHemmen@users.noreply.gitlab.com> Date: Sat, 26 Mar 2022 19:26:28 +0000 Subject: [PATCH] Update .gitlab-ci.yml --- .gitlab-ci.yml | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4b99633..24cf5e6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ stages: # List of stages for jobs, and their order of execution - docker -docker: +docker-master: stage: docker image: docker:stable services: @@ -11,10 +11,24 @@ docker: script: - docker info - docker login registry.gitlab.com -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD - - docker build -t registry.gitlab.com/guillaumehemmen/sonar-scanner/$CI_COMMIT_REF_NAME:latest . - - docker push registry.gitlab.com/guillaumehemmen/sonar-scanner/$CI_COMMIT_REF_NAME:latest - - docker build -t registry.gitlab.com/guillaumehemmen/sonar-scanner/$CI_COMMIT_REF_NAME:$CI_COMMIT_SHA . - - docker push registry.gitlab.com/guillaumehemmen/sonar-scanner/$CI_COMMIT_REF_NAME:$CI_COMMIT_SHA + - docker build -t registry.gitlab.com/guillaumehemmen/sonar-scanner:latest . + - docker push registry.gitlab.com/guillaumehemmen/sonar-scanner:latest + - docker build -t registry.gitlab.com/guillaumehemmen/sonar-scanner:$CI_COMMIT_SHA . + - docker push registry.gitlab.com/guillaumehemmen/sonar-scanner:$CI_COMMIT_SHA only: - master - - tags \ No newline at end of file + +docker-tag: + stage: docker + image: docker:stable + services: + - docker:dind + variables: + DOCKER_DRIVER: overlay2 + script: + - docker info + - docker login registry.gitlab.com -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD + - docker build -t registry.gitlab.com/guillaumehemmen/sonar-scanner:$CI_COMMIT_REF_NAME . + - docker push registry.gitlab.com/guillaumehemmen/sonar-scanner:$CI_COMMIT_REF_NAME + only: + - tags