ocr/.gitlab-ci.yml

42 lines
859 B
YAML
Raw Normal View History

2019-09-16 15:33:35 +02:00
image: docker:19.03.1
2019-09-16 15:30:11 +02:00
services:
2019-09-16 15:33:35 +02:00
- docker:19.03.1-dind
2019-09-16 15:30:11 +02:00
2019-06-04 12:18:31 +02:00
stages:
- build
- push
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
Build:
script:
- docker build --pull -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
stage: build
tags:
- docker
Push latest:
only:
- master
script:
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:latest
- docker push $CI_REGISTRY_IMAGE:latest
stage: push
tags:
- docker
Push tag:
only:
- tags
script:
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
stage: push
2019-03-13 18:17:08 +01:00
tags:
2019-06-04 12:18:31 +02:00
- docker