Using gitlab variables
This commit is contained in:
parent
dd2854b5ea
commit
29072821ba
@ -7,19 +7,28 @@ services:
|
|||||||
- leenooks/ci-docker:dind
|
- leenooks/ci-docker:dind
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
REGISTRY: registry.leenooks.net
|
VERSION: 6
|
||||||
IMAGE: leenooks/base
|
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
|
- env|sort
|
||||||
- docker info
|
- docker info
|
||||||
- docker version
|
- docker version
|
||||||
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN ${REGISTRY}
|
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN ${REGISTRY}
|
||||||
|
|
||||||
|
test:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- docker build -t ${IMAGE}:${VERSION} .
|
||||||
|
only:
|
||||||
|
- debug
|
||||||
|
|
||||||
build:
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
script:
|
script:
|
||||||
- docker build -t ${IMAGE} .
|
- docker build -t ${IMAGE}:${VERSION} .
|
||||||
- docker tag ${IMAGE} ${REGISTRY}/${IMAGE}
|
- docker tag ${IMAGE}:${VERSION} ${REGISTRY}/${IMAGE}:${VERSION}
|
||||||
- docker push ${REGISTRY}/${IMAGE}
|
- docker push ${REGISTRY}/${IMAGE}:${VERSION}
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
only:
|
||||||
|
- c6
|
||||||
|
Reference in New Issue
Block a user