.gitlab-ci.yml: add automated registry push on master

This commit is contained in:
Adhityaa 2018-06-09 11:11:13 +05:30
parent 452e1a6442
commit 5c5f5b6230

View File

@ -2,6 +2,7 @@ stages:
- build-src - build-src
- build-docker - build-docker
- go-test - go-test
- docker-registry
build-src: build-src:
stage: build-src stage: build-src
@ -41,3 +42,17 @@ go-test:
- cd api - cd api
- (go get -v . || true) # TODO: remove this ugly hack - (go get -v . || true) # TODO: remove this ugly hack
- go test -v . - go test -v .
docker-registry:
stage: docker-registry
image: docker:stable
services:
- docker:dind
only:
- master
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
script:
- docker pull registry.gitlab.com/commento/commento-ce:latest || true
- docker build --cache-from registry.gitlab.com/commento/commento-ce:latest --tag registry.gitlab.com/commento/commento-ce:latest .
- docker push registry.gitlab.com/commento/commento-ce:latest