infrastructure/.gitlab-ci.yml

15 lines
806 B
YAML
Raw Normal View History

2018-12-01 23:23:22 +00:00
build:signal-server:
tags:
- docker-builder
image: docker:latest
stage: build
script:
- docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
- docker build -t ${CI_REGISTRY_IMAGE}/signal-server:${CI_COMMIT_SHA:0:8} .
- export VERSION=$(docker run ${CI_REGISTRY_IMAGE}/signal-server:${CI_COMMIT_SHA:0:8} -v)
- docker tag ${CI_REGISTRY_IMAGE}/signal-server:${CI_COMMIT_SHA:0:8} ${CI_REGISTRY_IMAGE}/signal-server:${CI_COMMIT_REF_SLUG}
- docker tag ${CI_REGISTRY_IMAGE}/signal-server:${CI_COMMIT_SHA:0:8} ${CI_REGISTRY_IMAGE}/signal-server:${VERSION}
- docker push ${CI_REGISTRY_IMAGE}/signal-server:${CI_COMMIT_SHA:0:8}
- docker push ${CI_REGISTRY_IMAGE}/signal-server:${CI_COMMIT_REF_SLUG}
- docker push ${CI_REGISTRY_IMAGE}/signal-server:${VERSION}