mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-14 16:55:42 +00:00
Add CI script
This commit is contained in:
parent
b9a8c63aee
commit
fc69eedfea
52
.gitlab-ci.yml
Normal file
52
.gitlab-ci.yml
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
image: docker:latest
|
||||||
|
|
||||||
|
services:
|
||||||
|
- docker:dind
|
||||||
|
|
||||||
|
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 development:
|
||||||
|
only:
|
||||||
|
- development
|
||||||
|
script:
|
||||||
|
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
|
||||||
|
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:development
|
||||||
|
- docker push $CI_REGISTRY_IMAGE:development
|
||||||
|
stage: push
|
||||||
|
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
|
||||||
|
tags:
|
||||||
|
- docker
|
@ -9,7 +9,7 @@ services:
|
|||||||
env_file:
|
env_file:
|
||||||
- opaque_database_env
|
- opaque_database_env
|
||||||
- opaque_env
|
- opaque_env
|
||||||
image: gitlab.ub.uni-bielefeld.de:4567/sfb1288inf/opaque:latest
|
image: gitlab.ub.uni-bielefeld.de:4567/sfb1288inf/opaque:development
|
||||||
ports:
|
ports:
|
||||||
- 5000:5000
|
- 5000:5000
|
||||||
restart: always
|
restart: always
|
||||||
|
Loading…
Reference in New Issue
Block a user