45 lines
895 B
YAML
45 lines
895 B
YAML
# tahapan
|
|
stages:
|
|
- cleaning
|
|
- build_image
|
|
- deploy
|
|
|
|
# build image on development server
|
|
build_image:
|
|
stage: build_image
|
|
before_script:
|
|
- cp $ENV_FILE $CI_PROJECT_DIR/.env
|
|
script:
|
|
- echo "Isi file .env:"
|
|
- cat .env
|
|
- docker build -t 36.66.3.44:7007/$PROJECT_NAME:$CI_PIPELINE_ID .
|
|
- docker push 36.66.3.44:7007/$PROJECT_NAME:$CI_PIPELINE_ID
|
|
environment:
|
|
only:
|
|
- main
|
|
tags:
|
|
- runner-internal-his
|
|
|
|
# deploy to development server
|
|
deploy_development:
|
|
stage: deploy
|
|
script:
|
|
- docker stack deploy --compose-file compose.yml email-notification
|
|
environment:
|
|
only:
|
|
- main
|
|
tags:
|
|
- runner-internal-his
|
|
|
|
# deploy to development server
|
|
cleaning_image_and_container:
|
|
stage: cleaning
|
|
script:
|
|
- echo y | docker container prune
|
|
- echo y | docker image prune -a
|
|
environment:
|
|
only:
|
|
- main
|
|
tags:
|
|
- runner-internal-his
|