Improve caching for the build step

This commit is contained in:
ErickSkrauch 2019-08-03 22:10:29 +03:00
parent d333798919
commit 663cfd9dbc

View File

@ -5,7 +5,7 @@ stages:
- cleanup
.defineVersion: &defineVersion |-
export VERSION="${CI_COMMIT_TAG:-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}}"
export VERSION="${CI_COMMIT_TAG:-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA:0:7}}"
.loginIntoRegistry: &loginIntoRegistry |-
docker login -u gitlab-ci -p $CI_BUILD_TOKEN registry.ely.by
@ -82,6 +82,7 @@ build:production:
--pull
--target web
--build-arg "build_env=prod"
--cache-from "$APP_IMAGE_NAME:latest"
--cache-from "$WEB_IMAGE_NAME:latest"
-t "$WEB_IMAGE_NAME:$CI_PIPELINE_ID" .
- >
@ -89,6 +90,7 @@ build:production:
--pull
--target db
--build-arg "build_env=prod"
--cache-from "$APP_IMAGE_NAME:latest"
--cache-from "$DB_IMAGE_NAME:latest"
-t "$DB_IMAGE_NAME:$CI_PIPELINE_ID" .
only: