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