Commit fdbb0d5c authored by Rémi Cailletaud's avatar Rémi Cailletaud

full ci with blue green

parent 1581cedf
.job_template: &deploy_job
stage: deploy
except:
- /^version-.*$/
when: manual
image: docker
before_script:
- cd python-dice
script:
- docker pull ciformation/dice-server:latest
- if [ "$(docker ps -q -f name=dice-$CI_JOB_NAME)" ]; then docker stop dice-$CI_JOB_NAME; fi;
- docker run --name dice-$CI_JOB_NAME -d --rm -p $PORT:8081 ciformation/dice-server:latest
image : python:3
stages :
......@@ -65,18 +79,14 @@ build:
- echo $DOCKER_PASSWORD | docker login -u $DOCKER_LOGIN --password-stdin
- docker push $DOCKER_LOGIN/dice-server
deploy:
stage: deploy
except:
- /^version-.*$/
when: manual
image: docker
blue:
<<: *deploy_job
variables:
DOCKER_HOST: "osug-docker-ci.u-ga.fr:2376"
before_script:
- docker info
- cd python-dice
script:
- docker pull ciformation/dice-server:latest
- if [ "$(docker ps -q -f name=dice)" ]; then docker stop dice; fi;
- docker run --name dice -d --rm -p 8090:8081 ciformation/dice-server:latest
PORT: 8090
green:
<<: *deploy_job
variables:
DOCKER_HOST: "osug-docker-ci.u-ga.fr:2376"
PORT: 8091
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment