|
17 | 17 |
|
18 | 18 | set -eu |
19 | 19 |
|
20 | | -export TAG=2.15.4; |
21 | | -export DEPLOYER_VERSION=2.15; |
22 | | -export REGISTRY=gcr.io/virtru-public/staging/gateway; |
| 20 | +if [[ "${ENVIRONMENT:-}" = 'production' ]]; then |
| 21 | + export REGISTRY=gcr.io/virtru-public/gateway; |
| 22 | + printf 'Deploying to production. Using registry [%s]\n' $REGISTRY |
| 23 | +else |
| 24 | + export REGISTRY=gcr.io/virtru-public/staging/gateway; |
| 25 | + printf 'Deploying to staging. Using registry [%s]\n' $REGISTRY |
| 26 | +fi |
| 27 | + |
| 28 | +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" |
| 29 | +VERSION="$(< "${SCRIPT_DIR}/VERSION" )" |
| 30 | + |
| 31 | +export TAG="${VERSION}"; |
| 32 | +export DEPLOYER_VERSION="$(echo "${VERSION}" | cut -d'.' -f 1-2)"; |
| 33 | + |
| 34 | +printf 'Using container tag = [%s] and deployer version = [%s]\n' $TAG $DEPLOYER_VERSION |
| 35 | + |
23 | 36 | docker build --no-cache --build-arg TAG=$TAG --build-arg REGISTRY=$REGISTRY \ |
24 | | - -t "${REGISTRY}/deployer:${DEPLOYER_VERSION}" -f dev.Dockerfile . |
| 37 | + -t "${REGISTRY}/deployer:${DEPLOYER_VERSION}" -f dev.Dockerfile "${SCRIPT_DIR}" |
| 38 | + |
25 | 39 | docker push "${REGISTRY}/deployer:${DEPLOYER_VERSION}" |
26 | 40 |
|
27 | 41 | # reportingSecret: |
28 | 42 | # To actually report to the real Google ServiceControlEndpoint use "gateway-reportingsecret" |
29 | 43 | # To make sure not to bill, use "gs://cloud-marketplace-tools/reporting_secrets/fake_reporting_secret.yaml"}' |
| 44 | +parameters=$(cat <<virtruparams |
| 45 | +{ |
| 46 | + "name": "gateway", |
| 47 | + "namespace": "virtru", |
| 48 | + "gatewayHostname": "gateway-development.virtru.com", |
| 49 | + "gatewayApiTokenName": "token", |
| 50 | + "gatewayApiSecret": "mysecret", |
| 51 | + "numberOfLicenses":"10", |
| 52 | + "primaryMailingDomain":"virtru.example.com", |
| 53 | + "reportingSecret":"gs://cloud-marketplace-tools/reporting_secrets/fake_reporting_secret.yaml" |
| 54 | +} |
| 55 | +virtruparams |
| 56 | +) |
30 | 57 |
|
31 | 58 | # mpdev install to install, mpdev verify to test |
32 | | -mpdev install --deployer="${REGISTRY}/deployer:${DEPLOYER_VERSION}" \ |
33 | | ---parameters='{"name": "gateway", "namespace": "virtru", "gatewayHostname": "gateway-development.virtru.com", "gatewayApiTokenName": "token", "gatewayApiSecret": "mysecret", "numberOfLicenses":"10", "primaryMailingDomain":"virtru.example.com", "reportingSecret":"gs://cloud-marketplace-tools/reporting_secrets/fake_reporting_secret.yaml"}' |
| 59 | +mpdev install --deployer="${REGISTRY}/deployer:${DEPLOYER_VERSION}" --parameters="${parameters}" |
0 commit comments