mirror of
https://github.com/elyby/accounts.git
synced 2024-12-25 22:59:53 +05:30
Fix gitlab-ci configuration
This commit is contained in:
parent
80edf03b52
commit
6cd50f759c
@ -4,6 +4,7 @@ stages:
|
|||||||
- prepare
|
- prepare
|
||||||
- testing
|
- testing
|
||||||
- build
|
- build
|
||||||
|
- cleanup
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
APP_IMAGE_NAME: "$CI_REGISTRY_IMAGE/app"
|
APP_IMAGE_NAME: "$CI_REGISTRY_IMAGE/app"
|
||||||
@ -103,8 +104,6 @@ Codeception:
|
|||||||
Docker images:
|
Docker images:
|
||||||
stage: build
|
stage: build
|
||||||
image: docker:19.03.2
|
image: docker:19.03.2
|
||||||
services:
|
|
||||||
- docker:dind
|
|
||||||
before_script:
|
before_script:
|
||||||
- *defineVars
|
- *defineVars
|
||||||
- *dockerLogin
|
- *dockerLogin
|
||||||
@ -143,12 +142,30 @@ Docker images:
|
|||||||
-t "$DB_VERSIONED_IMAGE_NAME"
|
-t "$DB_VERSIONED_IMAGE_NAME"
|
||||||
-t "$DB_LATEST_IMAGE_NAME" .
|
-t "$DB_LATEST_IMAGE_NAME" .
|
||||||
# Push images to the registry
|
# Push images to the registry
|
||||||
- docker push $APP_IMAGE_VERSIONED_NAME
|
- docker push $APP_VERSIONED_IMAGE_NAME
|
||||||
- docker push $APP_IMAGE_LATEST_NAME
|
- docker push $APP_LATEST_IMAGE_NAME
|
||||||
- docker push $WEB_IMAGE_VERSIONED_NAME
|
- docker push $WEB_VERSIONED_IMAGE_NAME
|
||||||
- docker push $WEB_IMAGE_LATEST_NAME
|
- docker push $WEB_LATEST_IMAGE_NAME
|
||||||
- docker push $DB_IMAGE_VERSIONED_NAME
|
- docker push $DB_VERSIONED_IMAGE_NAME
|
||||||
- docker push $DB_IMAGE_LATEST_NAME
|
- docker push $DB_LATEST_IMAGE_NAME
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
- tags
|
||||||
|
|
||||||
|
#################
|
||||||
|
# Cleanup stage #
|
||||||
|
#################
|
||||||
|
|
||||||
|
cleanup:
|
||||||
|
stage: cleanup
|
||||||
|
image: docker:19.03.2
|
||||||
|
variables:
|
||||||
|
GIT_STRATEGY: none
|
||||||
|
script:
|
||||||
|
- docker rmi "$APP_LATEST_IMAGE_NAME" "$APP_VERSIONED_IMAGE_NAME" || true
|
||||||
|
- docker rmi "$WEB_LATEST_IMAGE_NAME" "$WEB_VERSIONED_IMAGE_NAME" || true
|
||||||
|
- docker rmi "$DB_LATEST_IMAGE_NAME" "$DB_VERSIONED_IMAGE_NAME" || true
|
||||||
|
when: always
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
- tags
|
- tags
|
||||||
|
Loading…
Reference in New Issue
Block a user