mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/cqpserver.git
synced 2024-12-26 03:14:20 +00:00
Add CI script.
This commit is contained in:
parent
2bb169264c
commit
43f2bb6e87
44
.gitlab-ci.yml
Normal file
44
.gitlab-ci.yml
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
image: docker:stable
|
||||||
|
|
||||||
|
services:
|
||||||
|
- docker:stable-dind
|
||||||
|
|
||||||
|
variables:
|
||||||
|
DOCKER_DRIVER: overlay2
|
||||||
|
|
||||||
|
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:tmp .
|
||||||
|
- docker push $CI_REGISTRY_IMAGE:tmp
|
||||||
|
stage: build
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
Push latest:
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
script:
|
||||||
|
- docker pull $CI_REGISTRY_IMAGE:tmp
|
||||||
|
- docker tag $CI_REGISTRY_IMAGE:tmp $CI_REGISTRY_IMAGE:latest
|
||||||
|
- docker push $CI_REGISTRY_IMAGE:latest
|
||||||
|
stage: push
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
Push tag:
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
script:
|
||||||
|
- docker pull $CI_REGISTRY_IMAGE:tmp
|
||||||
|
- docker tag $CI_REGISTRY_IMAGE:tmp $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
|
||||||
|
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
|
||||||
|
stage: push
|
||||||
|
tags:
|
||||||
|
- docker
|
Loading…
Reference in New Issue
Block a user