Restart prod container always. Remove staging from .gitlab-ci since it wasn't even running

This commit is contained in:
Karl Cordes 2020-10-31 17:21:49 +11:00
parent a70488ec9d
commit 8787b25115
2 changed files with 1 additions and 15 deletions

View file

@ -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

View file

@ -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 \