2019-09-16 13:58:42 +00:00
|
|
|
image: docker:stable
|
2019-09-06 11:00:11 +00:00
|
|
|
|
2019-09-19 07:23:20 +00:00
|
|
|
services:
|
|
|
|
- docker:stable-dind
|
|
|
|
|
2019-09-16 13:58:42 +00:00
|
|
|
variables:
|
|
|
|
DOCKER_DRIVER: overlay2
|
2019-09-06 11:00:11 +00:00
|
|
|
|
|
|
|
stages:
|
|
|
|
- build
|
|
|
|
- push
|
|
|
|
|
|
|
|
before_script:
|
|
|
|
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
|
|
|
|
|
|
|
Build:
|
|
|
|
script:
|
2019-11-04 14:06:54 +00:00
|
|
|
- docker build --pull -t $CI_REGISTRY_IMAGE:tmp .
|
|
|
|
- docker push $CI_REGISTRY_IMAGE:tmp
|
2019-09-06 11:00:11 +00:00
|
|
|
stage: build
|
|
|
|
tags:
|
|
|
|
- docker
|
|
|
|
|
|
|
|
Push development:
|
|
|
|
only:
|
|
|
|
- development
|
|
|
|
script:
|
2019-11-04 14:06:54 +00:00
|
|
|
- docker pull $CI_REGISTRY_IMAGE:tmp
|
|
|
|
- docker tag $CI_REGISTRY_IMAGE:tmp $CI_REGISTRY_IMAGE:development
|
2019-09-06 11:00:11 +00:00
|
|
|
- docker push $CI_REGISTRY_IMAGE:development
|
|
|
|
stage: push
|
|
|
|
tags:
|
|
|
|
- docker
|
|
|
|
|
|
|
|
Push latest:
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
script:
|
2019-11-04 14:06:54 +00:00
|
|
|
- docker pull $CI_REGISTRY_IMAGE:tmp
|
|
|
|
- docker tag $CI_REGISTRY_IMAGE:tmp $CI_REGISTRY_IMAGE:latest
|
2019-09-06 11:00:11 +00:00
|
|
|
- docker push $CI_REGISTRY_IMAGE:latest
|
|
|
|
stage: push
|
|
|
|
tags:
|
|
|
|
- docker
|
|
|
|
|
|
|
|
Push tag:
|
|
|
|
only:
|
|
|
|
- tags
|
|
|
|
script:
|
2019-11-04 14:06:54 +00:00
|
|
|
- docker pull $CI_REGISTRY_IMAGE:tmp
|
|
|
|
- docker tag $CI_REGISTRY_IMAGE:tmp $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
|
2019-09-06 11:00:11 +00:00
|
|
|
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
|
|
|
|
stage: push
|
|
|
|
tags:
|
|
|
|
- docker
|