forked from ThoughtWorksInc/cd4ml-workshop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
executable file
·18 lines (15 loc) · 653 Bytes
/
deploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env bash
set -xe
IMAGE_VERSION=${GO_PIPELINE_LABEL:-latest}
PROJECT_ID=${GCLOUD_PROJECT_ID:-continuous-intelligence}
TENANT_NAMESPACE=${TENANT:-admin}
FLUENTD_HOST=${FLUENTD_HOST:-""}
FLUENTD_PORT=${FLUENTD_PORT:-""}
echo "Deploying image version: $IMAGE_VERSION"
cat kubernetes/web.yml \
| sed "s/\\\$tenant\\\$/$TENANT_NAMESPACE/" \
| sed "s/\\\$fluentd_host\\\$/$FLUENTD_HOST/" \
| sed "s/\\\$fluentd_port\\\$/$FLUENTD_PORT/" \
| sed "s/\(image: \).*$/\1eu.gcr.io\/$PROJECT_ID\/ci-workshop-app:$TENANT_NAMESPACE.$IMAGE_VERSION/" \
| kubectl apply -f -
echo "Access your application at: http://$TENANT_NAMESPACE.app.cd4ml.net"