Commit e04e058e authored by Matija Obreza's avatar Matija Obreza
Browse files

Deploy master branch to staging automatically

parent 8f437af6
......@@ -29,7 +29,6 @@ package genesys:
stage: package
only:
- master
- staging
- tags
package genesys branch:
......@@ -38,7 +37,6 @@ package genesys branch:
when: manual
except:
- master
- staging
- tags
......@@ -79,7 +77,6 @@ dockerize genesys:
- package genesys
only:
- master
- staging
- tags
dockerize genesys branch:
......@@ -90,7 +87,6 @@ dockerize genesys branch:
when: manual
except:
- master
- staging
- tags
......@@ -152,6 +148,8 @@ remove review instance:
deploy on staging server:
stage: deploy
image: docker:latest
only:
- master
variables:
GIT_STRATEGY: none
script:
......@@ -167,9 +165,7 @@ deploy on staging server:
- export DOCKER_CERT_PATH=${TLS_PATH}
- DOCKER_CMD=docker
# Actions
# - ${DOCKER_CMD} stack rm genesys-${CI_COMMIT_REF_SLUG}-review
only:
- staging
- ${DOCKER_CMD} service update --image ${CI_REGISTRY_IMAGE}:${GENESYS_VERSION} sandbox_server
environment:
name: sandbox
url: https://sandbox.genesys-pgr.org
......@@ -182,6 +178,20 @@ deploy to production:
GIT_STRATEGY: none
script:
- echo "Deploy to production server"
# 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} service update --image ${CI_REGISTRY_IMAGE}:${GENESYS_VERSION} genesys_server
- sleep 90
- ${DOCKER_CMD} service update --image ${CI_REGISTRY_IMAGE}:${GENESYS_VERSION} genesys_standby
only:
- master
environment:
......
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