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