From 4e3aef2a16b42d772df76feb60eeaa82ccb6d2c4 Mon Sep 17 00:00:00 2001 From: Jerry Trieu Date: Mon, 27 Feb 2017 14:01:36 +0100 Subject: [PATCH] Deploy internal service as well --- deploy/deploy.sh | 17 +++++++++++++++-- deploy/service.json | 6 +++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/deploy/deploy.sh b/deploy/deploy.sh index 5aa070a..bebf6c1 100755 --- a/deploy/deploy.sh +++ b/deploy/deploy.sh @@ -30,9 +30,22 @@ fi # Merge service environment variables with secrets from this vault endpoint. export CATALOG_ADDR="http://catalog.gw.prod01.internal.advancedtelematic.com" -REQ=$(envsubst < deploy/service.json) -curl --show-error --silent --fail \ +function deploy { + REQ=$(envsubst < deploy/service.json) + curl --show-error --silent --fail \ --header "X-Vault-Token: ${VAULT_TOKEN}" \ --request POST \ --data "$REQ" \ ${CATALOG_ADDR}/service/${VAULT_ENDPOINT} +} + +export SERVICE_SCOPE="public" +export AUTH_PROTOCOL="oauth.accesstoken" +export AUTH_VERIFICATION="auth-plus" +deploy + +export JOB_NAME="${JOB_NAME}-internal" +export SERVICE_SCOPE="internal" +export AUTH_PROTOCOL="none" +export AUTH_VERIFICATION="none" +deploy diff --git a/deploy/service.json b/deploy/service.json index 14ae771..5820707 100644 --- a/deploy/service.json +++ b/deploy/service.json @@ -26,14 +26,14 @@ }, "env": { "SERVICE_NAME": "${JOB_NAME}", - "SERVICE_SCOPE": "public", + "SERVICE_SCOPE": "${SERVICE_SCOPE}", "SERVICE_TYPE": "http", "SERVICE_IMAGE": "${IMAGE_ARTIFACT}", "SERVICE_HEALTH_CHECK": "curl --show-error --silent %s:%s/health", "BIND_HOST": "0.0.0.0", "BIND_PORT": "8084", - "AUTH_PROTOCOL": "oauth.accesstoken", - "AUTH_VERIFICATION": "auth-plus", + "AUTH_PROTOCOL": "${AUTH_PROTOCOL}", + "AUTH_VERIFICATION": "${AUTH_VERIFICATION}", "DB_MIGRATE": "true", "TREEHUB_LOCAL_STORE_PATH": "/data/treehub-repos", "JAVA_OPTS": "${JAVA_OPTS}",