Skip to content
Snippets Groups Projects
Commit bd7ada78 authored by Chris Hines's avatar Chris Hines
Browse files

update gitlabci

parent 359ef60b
No related branches found
No related tags found
4 merge requests!77Revert "disable agressive kill and restart",!35Dev,!22Dev,!21update gitlabci
Pipeline #10278 passed
...@@ -30,13 +30,13 @@ deploy_test: ...@@ -30,13 +30,13 @@ deploy_test:
variables: variables:
DOCKER_HOST: unix:///var/run/docker.sock DOCKER_HOST: unix:///var/run/docker.sock
script: script:
- echo "deploying dev" - echo "deploying test"
- docker login -u $DOCKERHUBUSER -p $DOCKERHUBPASSWORD docker.io - docker login -u $DOCKERHUBUSER -p $DOCKERHUBPASSWORD docker.io
- docker stop strudel2_backend || echo "Failed to stop existing container" - docker stop strudel2_backend || echo "Failed to stop existing container"
- docker ps -a -q | xargs -I{} docker rm {} || echo "No containers to remove" - docker ps -a -q | xargs -I{} docker rm {} || echo "No containers to remove"
- docker images -q | xargs -I{} docker rmi {} || echo "No images to remove" - docker images -q | xargs -I{} docker rmi {} || echo "No images to remove"
- docker pull l1ll1/strudel2_backend:latest - docker pull l1ll1/strudel2_backend:$CI_COMMIT_BRANCH
- docker run --mount type=bind,source=/messages,target=/messages -d -p 8080:8080 -p 8090:8090 --name strudel2_backend l1ll1/strudel2_backend:latest || echo "Unable to start image ... possibly the old wsgi process is still running?" - docker run --mount type=bind,source=/messages,target=/messages -d -p 8080:8080 -p 8090:8090 --name strudel2_backend l1ll1/strudel2_backend:$CI_COMMIT_BRANCH || echo "Unable to start image ... possibly the old wsgi process is still running?"
dependencies: dependencies:
- build - build
...@@ -59,3 +59,22 @@ deploy_dev: ...@@ -59,3 +59,22 @@ deploy_dev:
dependencies: dependencies:
- build - build
deploy_prod:
stage: deploy
only:
- prod@hpc-team/strudel2_backend
tags:
- deploy_prod
variables:
DOCKER_HOST: unix:///var/run/docker.sock
script:
- echo "deploying prod"
- docker login -u $DOCKERHUBUSER -p $DOCKERHUBPASSWORD docker.io
- docker stop strudel2_backend || echo "Failed to stop existing container"
- docker ps -a -q | xargs -I{} docker rm {} || echo "No containers to remove"
- docker images -q | xargs -I{} docker rmi {} || echo "No images to remove"
- docker pull l1ll1/strudel2_backend:$CI_COMMIT_BRANCH
- docker run --mount type=bind,source=/messages,target=/messages -d -p 8080:8080 -p 8090:8090 --name strudel2_backend l1ll1/strudel2_backend:$CI_COMMIT_BRANCH || echo "Unable to start image ... possibly the old wsgi process is still running?"
dependencies:
- build
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment