Skip to content
Snippets Groups Projects
Commit e06d1cab authored by E. Madison Bray's avatar E. Madison Bray
Browse files

[ci] tag Docker images built from the master branch, and use them as a

starting point for docker builds on MRs/branches, which should speed
up those builds in most cases
parent 3f21e9a9
No related branches found
No related tags found
No related merge requests found
Pipeline #1290 failed
stages:
- "docker"
- "test"
- "deploy"
- "cleanup"
variables:
......@@ -29,7 +30,9 @@ docker:build:
before_script:
- "docker info"
script:
- "docker build --tag ${IMAGE_REGISTRY}:${CI_COMMIT_SHA} ."
- >
docker build --cache-from ${IMAGE_REGISTRY}:master
--tag ${IMAGE_REGISTRY}:${CI_COMMIT_SHA} .
.test: &test
......@@ -111,9 +114,26 @@ test:docker:
artifacts: {}
.docker:tag: &docker_tag
stage: deploy
image: docker:18
before_script:
- docker info
script:
- docker tag ${IMAGE_REGISTRY}:${CI_COMMIT_SHA} ${REGISTRY_IMAGE}:${TAG_NAME}
deploy:docker-master: *docker_tag
stage: "deploy"
image: "docker:${DOCKER_VERSION}"
only: "master"
variables:
TAG_NAME: "master"
cleanup:docker:
stage: "cleanup"
image: "docker:18"
image: "docker:${DOCKER_VERSION}"
only: *only
when: "always"
before_script:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment