mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nlp.git
synced 2024-12-27 13:34:18 +00:00
build script for different branches
This commit is contained in:
parent
5443c2882a
commit
297295f617
@ -1,10 +1,36 @@
|
|||||||
build:
|
stages:
|
||||||
|
- build
|
||||||
|
- push
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
||||||
|
|
||||||
|
Build:
|
||||||
|
stage: build
|
||||||
image: docker:latest
|
image: docker:latest
|
||||||
script:
|
script:
|
||||||
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
||||||
- docker build --pull -t $CI_REGISTRY_IMAGE .
|
- docker build --pull -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA .
|
||||||
- docker push $CI_REGISTRY_IMAGE
|
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
|
||||||
services:
|
services:
|
||||||
- docker:dind
|
- docker:dind
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
|
||||||
|
Push master:
|
||||||
|
stage: push
|
||||||
|
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
|
||||||
|
|
||||||
|
Push others:
|
||||||
|
stage: push
|
||||||
|
except:
|
||||||
|
- master
|
||||||
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user