Commit 0bdca61c authored by Matija Obreza's avatar Matija Obreza

Don't automatically deploy for review

parent 0ea3cfb1
......@@ -97,68 +97,68 @@ dockerize genesys branch:
- tags
deploy for review:
stage: deploy
image: docker:${DOCKER_VERSION}
except:
- master
- /^production-.*/
# when: manual
allow_failure: false
environment:
name: genesys/${CI_COMMIT_REF_SLUG}
url: https://${CI_ENVIRONMENT_SLUG}.review.genesys-pgr.org
on_stop: remove review instance
script:
# Address the swarm
- export DOCKER_HOST=swarm.genesys-pgr.org
# Configuration
- TLS_PATH=~/.docker/${DOCKER_HOST}/certs && mkdir -p ${TLS_PATH}
- echo "${DOCKER_TLS_CA}" > ${TLS_PATH}/ca.pem
- echo "${DOCKER_TLS_KEY}" > ${TLS_PATH}/key.pem
- echo "${DOCKER_TLS_CERT}" > ${TLS_PATH}/cert.pem
- export DOCKER_TLS_VERIFY=1
- export DOCKER_CERT_PATH=${TLS_PATH}
- DOCKER_CMD=docker
# Actions
- apk add --no-cache gettext
- if [ "${CI_COMMIT_REF_SLUG}" = "master" ] ; then
export IMAGE_TAG="${GENESYS_VERSION}";
else
export IMAGE_TAG="${GENESYS_VERSION}-${CI_COMMIT_REF_SLUG}";
fi
- echo Deploying ${CI_REGISTRY_IMAGE}:${IMAGE_TAG} for review as https\://${CI_ENVIRONMENT_SLUG}.review.genesys\-pgr.org
- envsubst < docker/review-compose-template.yml > review-composed.yml
# - cat review-composed.yml
- ${DOCKER_CMD} stack rm ${CI_ENVIRONMENT_SLUG} || true
- ${DOCKER_CMD} stack deploy -c review-composed.yml ${CI_ENVIRONMENT_SLUG}
# deploy for review:
# stage: deploy
# image: docker:${DOCKER_VERSION}
# except:
# - master
# - /^production-.*/
# # when: manual
# allow_failure: false
# environment:
# name: genesys/${CI_COMMIT_REF_SLUG}
# url: https://${CI_ENVIRONMENT_SLUG}.review.genesys-pgr.org
# on_stop: remove review instance
# script:
# # Address the swarm
# - export DOCKER_HOST=swarm.genesys-pgr.org
# # Configuration
# - TLS_PATH=~/.docker/${DOCKER_HOST}/certs && mkdir -p ${TLS_PATH}
# - echo "${DOCKER_TLS_CA}" > ${TLS_PATH}/ca.pem
# - echo "${DOCKER_TLS_KEY}" > ${TLS_PATH}/key.pem
# - echo "${DOCKER_TLS_CERT}" > ${TLS_PATH}/cert.pem
# - export DOCKER_TLS_VERIFY=1
# - export DOCKER_CERT_PATH=${TLS_PATH}
# - DOCKER_CMD=docker
# # Actions
# - apk add --no-cache gettext
# - if [ "${CI_COMMIT_REF_SLUG}" = "master" ] ; then
# export IMAGE_TAG="${GENESYS_VERSION}";
# else
# export IMAGE_TAG="${GENESYS_VERSION}-${CI_COMMIT_REF_SLUG}";
# fi
# - echo Deploying ${CI_REGISTRY_IMAGE}:${IMAGE_TAG} for review as https\://${CI_ENVIRONMENT_SLUG}.review.genesys\-pgr.org
# - envsubst < docker/review-compose-template.yml > review-composed.yml
# # - cat review-composed.yml
# - ${DOCKER_CMD} stack rm ${CI_ENVIRONMENT_SLUG} || true
# - ${DOCKER_CMD} stack deploy -c review-composed.yml ${CI_ENVIRONMENT_SLUG}
remove review instance:
stage: deploy
image: docker:${DOCKER_VERSION}
except:
- master
- /^production-.*/
when: manual
variables:
GIT_STRATEGY: none
environment:
name: genesys/${CI_COMMIT_REF_SLUG}
action: stop
script:
- echo Removing review https\://${CI_ENVIRONMENT_SLUG}.review.genesys\-pgr.org
# Address the swarm
- export DOCKER_HOST=swarm.genesys-pgr.org
# Configuration
- TLS_PATH=~/.docker/${DOCKER_HOST}/certs && mkdir -p ${TLS_PATH}
- echo "${DOCKER_TLS_CA}" > ${TLS_PATH}/ca.pem
- echo "${DOCKER_TLS_KEY}" > ${TLS_PATH}/key.pem
- echo "${DOCKER_TLS_CERT}" > ${TLS_PATH}/cert.pem
- export DOCKER_TLS_VERIFY=1
- export DOCKER_CERT_PATH=${TLS_PATH}
- DOCKER_CMD=docker
# Actions
- ${DOCKER_CMD} stack rm ${CI_ENVIRONMENT_SLUG} || true
# remove review instance:
# stage: deploy
# image: docker:${DOCKER_VERSION}
# except:
# - master
# - /^production-.*/
# when: manual
# variables:
# GIT_STRATEGY: none
# environment:
# name: genesys/${CI_COMMIT_REF_SLUG}
# action: stop
# script:
# - echo Removing review https\://${CI_ENVIRONMENT_SLUG}.review.genesys\-pgr.org
# # Address the swarm
# - export DOCKER_HOST=swarm.genesys-pgr.org
# # Configuration
# - TLS_PATH=~/.docker/${DOCKER_HOST}/certs && mkdir -p ${TLS_PATH}
# - echo "${DOCKER_TLS_CA}" > ${TLS_PATH}/ca.pem
# - echo "${DOCKER_TLS_KEY}" > ${TLS_PATH}/key.pem
# - echo "${DOCKER_TLS_CERT}" > ${TLS_PATH}/cert.pem
# - export DOCKER_TLS_VERIFY=1
# - export DOCKER_CERT_PATH=${TLS_PATH}
# - DOCKER_CMD=docker
# # Actions
# - ${DOCKER_CMD} stack rm ${CI_ENVIRONMENT_SLUG} || true
deploy on staging server:
stage: deploy
......
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