Updated .gitlab-ci.yml
This commit is contained in:
parent
dd2854b5ea
commit
025abc9d8e
@ -1,25 +1,37 @@
|
|||||||
image: leenooks/ci-docker:latest
|
image: leenooks/ci-docker:latest
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
|
- test
|
||||||
- build
|
- build
|
||||||
|
|
||||||
services:
|
services:
|
||||||
- leenooks/ci-docker:dind
|
- leenooks/ci-docker:dind
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
REGISTRY: registry.leenooks.net
|
VERSION: latest
|
||||||
IMAGE: leenooks/base
|
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
|
- test -n "${REGISTRY}" # Needs to be set in project
|
||||||
|
- test -n "${IMAGE}" # Needs to be set in project
|
||||||
- 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} .
|
||||||
|
- docker images
|
||||||
|
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:
|
||||||
|
- master
|
||||||
|
Reference in New Issue
Block a user