From 8787b25115dd23ee4b5c292101201f7192d5a1bd Mon Sep 17 00:00:00 2001 From: Karl Cordes Date: Sat, 31 Oct 2020 17:21:49 +1100 Subject: [PATCH] Restart prod container always. Remove staging from .gitlab-ci since it wasn't even running --- .gitlab-ci.yml | 14 -------------- run_docker_prd.sh | 2 +- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 04a1659a..7aecd883 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,19 +6,6 @@ build: stage: build script: - docker build --build-arg=COMMIT=$(git rev-parse --short HEAD) . -t "cmc:latest" - -deploy_staging: - stage: deploy - script: - - cd /home/cmc/staging/ - - git pull origin master - - echo "Run the new docker image" - - cp /home/cmc/staging/stagingpasswd /home/cmc/stagingpasswd - - /home/cmc/staging/run_docker_stg.sh - environment: - name: staging - only: - - master deploy_production: stage: deploy @@ -30,6 +17,5 @@ deploy_production: - /home/cmc/cmc-sales/run_docker_prd.sh environment: name: production - when: manual only: - master diff --git a/run_docker_prd.sh b/run_docker_prd.sh index c9e97b81..85fa4dc9 100755 --- a/run_docker_prd.sh +++ b/run_docker_prd.sh @@ -1,7 +1,7 @@ ID=$(docker ps -qf ancestor='cmc:latest') docker kill $ID sleep 1 -docker run -d -p 127.0.0.1:8888:80 \ +docker run -d --restart always -p 127.0.0.1:8888:80 \ --mount type=bind,source=/mnt/vault/pdf,target=/var/www/cmc-sales/app/webroot/pdf \ --mount type=bind,source=/mnt/vault/attachments_files,target=/var/www/cmc-sales/app/webroot/attachments_files \ --mount type=bind,source=/mnt/vault/emails,target=/var/www/emails \