mirror of
https://github.com/elyby/accounts.git
synced 2024-12-25 22:59:53 +05:30
Improve gitlab-ci configuration
This commit is contained in:
parent
c90331c372
commit
492118a0c0
@ -5,7 +5,7 @@ stages:
|
|||||||
- cleanup
|
- cleanup
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
VERSION: "${CI_COMMIT_TAG:-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA:0:7}}"
|
VERSION: "${CI_COMMIT_TAG:-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}}"
|
||||||
APP_IMAGE_NAME: "registry.ely.by/elyby/accounts"
|
APP_IMAGE_NAME: "registry.ely.by/elyby/accounts"
|
||||||
WEB_IMAGE_NAME: "registry.ely.by/elyby/accounts-nginx"
|
WEB_IMAGE_NAME: "registry.ely.by/elyby/accounts-nginx"
|
||||||
DB_IMAGE_NAME: "registry.ely.by/elyby/accounts-mariadb"
|
DB_IMAGE_NAME: "registry.ely.by/elyby/accounts-mariadb"
|
||||||
@ -60,24 +60,28 @@ build:production:
|
|||||||
stage: build
|
stage: build
|
||||||
before_script:
|
before_script:
|
||||||
- sed -i -e "s/{{PLACE_VERSION_HERE}}/$VERSION/g" common/config/config.php
|
- sed -i -e "s/{{PLACE_VERSION_HERE}}/$VERSION/g" common/config/config.php
|
||||||
|
- docker login -u gitlab-ci -p $CI_BUILD_TOKEN registry.ely.by
|
||||||
script:
|
script:
|
||||||
- >
|
- >
|
||||||
docker build
|
docker build
|
||||||
--pull
|
--pull
|
||||||
--target app
|
--target app
|
||||||
--build-arg "build_env=prod"
|
--build-arg "build_env=prod"
|
||||||
|
--cache-from "$APP_IMAGE_NAME:latest"
|
||||||
-t "$APP_IMAGE_NAME:$CI_PIPELINE_ID" .
|
-t "$APP_IMAGE_NAME:$CI_PIPELINE_ID" .
|
||||||
- >
|
- >
|
||||||
docker build
|
docker build
|
||||||
--pull
|
--pull
|
||||||
--target web
|
--target web
|
||||||
--build-arg "build_env=prod"
|
--build-arg "build_env=prod"
|
||||||
|
--cache-from "$WEB_IMAGE_NAME:latest"
|
||||||
-t "$WEB_IMAGE_NAME:$CI_PIPELINE_ID" .
|
-t "$WEB_IMAGE_NAME:$CI_PIPELINE_ID" .
|
||||||
- >
|
- >
|
||||||
docker build
|
docker build
|
||||||
--pull
|
--pull
|
||||||
--target db
|
--target db
|
||||||
--build-arg "build_env=prod"
|
--build-arg "build_env=prod"
|
||||||
|
--cache-from "$DB_IMAGE_NAME:latest"
|
||||||
-t "$DB_IMAGE_NAME:$CI_PIPELINE_ID" .
|
-t "$DB_IMAGE_NAME:$CI_PIPELINE_ID" .
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
|
Loading…
Reference in New Issue
Block a user