mirror of
https://github.com/elyby/accounts.git
synced 2024-12-03 12:10:57 +05:30
Improve caching for the build step
This commit is contained in:
parent
d333798919
commit
663cfd9dbc
@ -5,7 +5,7 @@ stages:
|
|||||||
- cleanup
|
- cleanup
|
||||||
|
|
||||||
.defineVersion: &defineVersion |-
|
.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 |-
|
.loginIntoRegistry: &loginIntoRegistry |-
|
||||||
docker login -u gitlab-ci -p $CI_BUILD_TOKEN registry.ely.by
|
docker login -u gitlab-ci -p $CI_BUILD_TOKEN registry.ely.by
|
||||||
|
|
||||||
@ -82,6 +82,7 @@ build:production:
|
|||||||
--pull
|
--pull
|
||||||
--target web
|
--target web
|
||||||
--build-arg "build_env=prod"
|
--build-arg "build_env=prod"
|
||||||
|
--cache-from "$APP_IMAGE_NAME:latest"
|
||||||
--cache-from "$WEB_IMAGE_NAME:latest"
|
--cache-from "$WEB_IMAGE_NAME:latest"
|
||||||
-t "$WEB_IMAGE_NAME:$CI_PIPELINE_ID" .
|
-t "$WEB_IMAGE_NAME:$CI_PIPELINE_ID" .
|
||||||
- >
|
- >
|
||||||
@ -89,6 +90,7 @@ build:production:
|
|||||||
--pull
|
--pull
|
||||||
--target db
|
--target db
|
||||||
--build-arg "build_env=prod"
|
--build-arg "build_env=prod"
|
||||||
|
--cache-from "$APP_IMAGE_NAME:latest"
|
||||||
--cache-from "$DB_IMAGE_NAME:latest"
|
--cache-from "$DB_IMAGE_NAME:latest"
|
||||||
-t "$DB_IMAGE_NAME:$CI_PIPELINE_ID" .
|
-t "$DB_IMAGE_NAME:$CI_PIPELINE_ID" .
|
||||||
only:
|
only:
|
||||||
|
Loading…
Reference in New Issue
Block a user