Verified Commit d7d11397 authored by guglielmo's avatar guglielmo
Browse files

deploy pipeline adjusted for traefik-based servers

parent a55e13ea
......@@ -17,9 +17,8 @@ deploy_staging:
cache: {}
variables:
DOCKER_TLS_VERIFY: "1"
DOCKER_HOST: "tcp://${STAGING_HOST_IP}:2376"
DOCKER_HOST: "tcp://${HOST_IP}:2376"
DOCKER_CERT_PATH: "certs"
DOMAINS: ${DOMAINS_STAGING}
USE_EMAIL_SMTP: "off"
FONTAWESOME_TOKEN: ${FONTAWESOME_TOKEN}
script:
......@@ -28,8 +27,8 @@ deploy_staging:
- echo "$CLIENT_CERT" > $DOCKER_CERT_PATH/cert.pem
- echo "$CLIENT_KEY" > $DOCKER_CERT_PATH/key.pem
- docker build --build-arg FONTAWESOME_TOKEN=${FONTAWESOME_TOKEN} --compress -t openpolis/opdm/opdm-web:latest .
- docker-compose down
- docker-compose up -d
- docker-compose -f docker-compose.yml -f docker-compose.staging.yml down
- docker-compose -f docker-compose.yml -f docker-compose.staging.yml up -d
- rm -rf $DOCKER_CERT_PATH
only:
- master
......@@ -37,7 +36,7 @@ deploy_staging:
- docker
environment:
name: staging
url: https://${DOMAINS_STAGING}
url: https://${DOMAIN}
deploy_production:
image: tmaier/docker-compose:latest
......@@ -45,9 +44,8 @@ deploy_production:
cache: {}
variables:
DOCKER_TLS_VERIFY: "1"
DOCKER_HOST: "tcp://${PRODUCTION_HOST_IP}:2376"
DOCKER_HOST: "tcp://${HOST_IP}:2376"
DOCKER_CERT_PATH: "certs"
DOMAINS: ${DOMAINS_PRODUCTION}
FONTAWESOME_TOKEN: ${FONTAWESOME_TOKEN}
script:
- mkdir $DOCKER_CERT_PATH
......@@ -65,5 +63,5 @@ deploy_production:
- docker
environment:
name: production
url: https://${DOMAINS_PRODUCTION}
url: https://${DOMAIN}
......@@ -11,14 +11,14 @@ services:
expose:
- "80"
environment:
- VIRTUAL_HOST=${DOMAINS}
- LETSENCRYPT_HOST=${DOMAINS}
- VIRTUAL_HOST=${DOMAIN}
- LETSENCRYPT_HOST=${DOMAIN}
- LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL}
- FONTAWESOME_TOKEN=${FONTAWESOME_TOKEN}
labels:
- "traefik.enable=true"
- "traefik.docker.network=gw"
- "traefik.http.routers.opdm-front.rule=Host(`$DOMAINS`)"
- "traefik.http.routers.opdm-front.rule=Host(`$DOMAIN`)"
- "traefic.http.routers.opdm-front.entrypoint=websecure"
- "traefik.http.routers.opdm-front.tls.certresolver=${CERT_RESOLVER}"
......
......@@ -6,15 +6,17 @@
export const environment = {
production: false,
API: {
/* dev
/* dev */
baseURL: 'http://localhost:8001/v1/',
authURL: 'http://localhost:8001/api-token-auth/',
authRefreshURL: 'http://localhost:8001/api-token-refresh/'
*/
/* staging */
baseURL: 'https://staging.service.opdm.openpolis.io/v1/',
authURL: 'https://staging.service.opdm.openpolis.io/api-token-auth/',
authRefreshURL: 'https://staging.service.opdm.openpolis.io/api-token-refresh/'
/* staging */
/*
baseURL: 'https://staging2.service.opdm.openpolis.io/v1/',
authURL: 'https://staging2.service.opdm.openpolis.io/api-token-auth/',
authRefreshURL: 'https://staging2.service.opdm.openpolis.io/api-token-refresh/'
*/
}
};
Supports Markdown
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