summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLuca Orlandi <luca.orlandi@gmail.com>2019-05-21 14:09:49 +0000
committerKamil TrzciƄski <ayufan@ayufan.eu>2019-05-21 14:09:49 +0000
commit96200113f0fad8e003c958000f34bc4b808dc556 (patch)
tree662e7a5d8ca7b538e324c1edfeeb301abd28f9ff /lib
parente556b421c503a067908d6937a2deb74310037a29 (diff)
downloadgitlab-ce-96200113f0fad8e003c958000f34bc4b808dc556.tar.gz
Jobs should be better isolated to avoid interference with other `image` or `before_script` statements.
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/ci/templates/Docker.gitlab-ci.yml21
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/gitlab/ci/templates/Docker.gitlab-ci.yml b/lib/gitlab/ci/templates/Docker.gitlab-ci.yml
index eeefadaa019..f6d240b7b6d 100644
--- a/lib/gitlab/ci/templates/Docker.gitlab-ci.yml
+++ b/lib/gitlab/ci/templates/Docker.gitlab-ci.yml
@@ -1,14 +1,11 @@
-# Official docker image.
-image: docker:latest
-
-services:
- - docker:dind
-
-before_script:
- - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
-
build-master:
+ # Official docker image.
+ image: docker:latest
stage: build
+ services:
+ - docker:dind
+ before_script:
+ - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE" .
- docker push "$CI_REGISTRY_IMAGE"
@@ -16,7 +13,13 @@ build-master:
- master
build:
+ # Official docker image.
+ image: docker:latest
stage: build
+ services:
+ - docker:dind
+ before_script:
+ - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" .
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"