From 1c1d2d07f6e72fabb76ff968daff701720db1288 Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Wed, 24 Apr 2019 00:28:54 +0200 Subject: [PATCH] Cache builder stage --- .gitlab-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cffd741..9c2915f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,6 +9,7 @@ stages: variables: DOCKER_HOST: tcp://docker:2375 DOCKER_DRIVER: overlay2 + CONTAINER_BUILDER_IMAGE: $CI_REGISTRY_IMAGE:builder-latest CONTAINER_TEST_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG CONTAINER_RELEASE_IMAGE: $CI_REGISTRY_IMAGE:latest CONTAINER_TAG_IMAGE: $CI_REGISTRY_IMAGE:${CI_COMMIT_TAG:1} @@ -22,6 +23,8 @@ build: - docker pull $CONTAINER_TEST_IMAGE || true - docker pull $CONTAINER_RELEASE_IMAGE || true - docker pull $CONTAINER_TAG_IMAGE || true + - docker pull $CONTAINER_BUILDER_IMAGE || true + - docker build --pull -t $CONTAINER_BUILDER_IMAGE --target builder . - docker build --pull -t $CONTAINER_TEST_IMAGE . - docker push $CONTAINER_TEST_IMAGE