Test new .gitlab-ci file with variable
This commit is contained in:
parent
177b1b6b09
commit
906d613669
@ -4,26 +4,26 @@ stages:
|
|||||||
- test
|
- test
|
||||||
- build
|
- build
|
||||||
|
|
||||||
services:
|
|
||||||
- registry.leenooks.net/leenooks/ci-docker:dind
|
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
VERSION: latest
|
VERSION: latest
|
||||||
DOCKER_HOST: tcp://registry.leenooks.net-leenooks-ci-docker:2375
|
DOCKER_IMAGE: leenooks/base
|
||||||
|
DOCKER_REGISTRY: registry.leenooks.net
|
||||||
|
DOCKER_HOST: tcp://${DOCKER_REGISTRY}-leenooks-ci-docker:2375
|
||||||
|
|
||||||
|
services:
|
||||||
|
- ${DOCKER_REGISTRY}/leenooks/ci-docker:dind
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- cat /etc/hosts
|
|
||||||
- env|sort
|
|
||||||
- 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 ${DOCKER_REGISTRY}
|
||||||
|
|
||||||
test:
|
test:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- docker build -t ${IMAGE}:${VERSION} .
|
- cat /etc/hosts
|
||||||
|
- env|sort
|
||||||
|
- docker build -t ${DOCKER_IMAGE}:${VERSION} .
|
||||||
- docker images
|
- docker images
|
||||||
only:
|
only:
|
||||||
- debug
|
- debug
|
||||||
@ -31,9 +31,9 @@ test:
|
|||||||
build:
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
script:
|
script:
|
||||||
- docker build -t ${IMAGE}:${VERSION} .
|
- docker build -t ${DOCKER_IMAGE}:${VERSION} .
|
||||||
- docker tag ${IMAGE}:${VERSION} ${REGISTRY}/${IMAGE}:${VERSION}
|
- docker tag ${DOCKER_IMAGE}:${VERSION} ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${VERSION}
|
||||||
- docker push ${REGISTRY}/${IMAGE}:${VERSION}
|
- docker push ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${VERSION}
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
only:
|
only:
|
||||||
|
Reference in New Issue
Block a user