mirror of
https://ops.gitlab.net/gitlab-org/gitlab-build-images.git
synced 2025-12-10 10:32:56 +01:00
Push images only on master
This commit is contained in:
parent
6ae6d22a7f
commit
66c1a55f98
1 changed files with 18 additions and 0 deletions
|
|
@ -9,11 +9,29 @@ variables:
|
||||||
before_script:
|
before_script:
|
||||||
- docker login -u "gitlab-ci-token" -p "$CI_BUILD_TOKEN" registry.gitlab.com
|
- docker login -u "gitlab-ci-token" -p "$CI_BUILD_TOKEN" registry.gitlab.com
|
||||||
|
|
||||||
|
.test_build: &test_build
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
# Hack to set an array in /bin/sh
|
||||||
|
# http://unix.stackexchange.com/a/137571
|
||||||
|
- set $CI_BUILD_NAME
|
||||||
|
- export JOB=$(printf '%s\n' "$1")
|
||||||
|
- docker build -f "Dockerfile.$JOB" .
|
||||||
|
except:
|
||||||
|
- master
|
||||||
|
|
||||||
.build_and_deploy: &build_and_deploy
|
.build_and_deploy: &build_and_deploy
|
||||||
stage: build
|
stage: build
|
||||||
script:
|
script:
|
||||||
- docker build -t "$CI_REGISTRY_IMAGE:$CI_BUILD_NAME" -f "Dockerfile.$CI_BUILD_NAME" .
|
- docker build -t "$CI_REGISTRY_IMAGE:$CI_BUILD_NAME" -f "Dockerfile.$CI_BUILD_NAME" .
|
||||||
- docker push "$CI_REGISTRY_IMAGE:$CI_BUILD_NAME"
|
- docker push "$CI_REGISTRY_IMAGE:$CI_BUILD_NAME"
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
|
||||||
|
ruby-2.1 test: *test_build
|
||||||
|
ruby-2.2 test: *test_build
|
||||||
|
ruby-2.3 test: *test_build
|
||||||
|
www-gitlab-com test: *test_build
|
||||||
|
|
||||||
ruby-2.1: *build_and_deploy
|
ruby-2.1: *build_and_deploy
|
||||||
ruby-2.2: *build_and_deploy
|
ruby-2.2: *build_and_deploy
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue