nopaque/.gitlab-ci.yml

56 lines
1.1 KiB
YAML
Raw Normal View History

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