-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathrun-app.sh
executable file
·39 lines (32 loc) · 1.08 KB
/
run-app.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
#
# Run this script after the project infrastructure has been created.
# This script will install and run the pipelines.
#
for i in "gcloud" "kubectl"; do
command -v "${i}" 2>&1 > /dev/null || { echo >&2 "${i} is not installed. Run the following command to install:
gcloud components install kubectl"; echo "${MESSAGE}"; exit 1; }
done
# Set Variables
export PROJECT_ID=$(gcloud config get-value project)
source config.sh
# Submit Build
gcloud builds submit --config "app/cloudbuild.yaml"
# Open the Grafana dashboad
gcloud container clusters get-credentials cluster --region ${REGION}
unset external_ip
while [ -z $external_ip ];
do echo "Waiting for Grafana end point ..."
external_ip=$(kubectl get ingress grafana -n grafana -o jsonpath='{.status.loadBalancer.ingress[].ip}')
sleep 5
done
echo "Grafana End point ready ...
Please visit the FSI Pattern dashboard here:
---
http://${external_ip}/d/9HXuXojGk/fsi-pattern
Username: ${PROJECT_ID}
Password: ${PROJECT_ID}
---
Done..."
sleep 10
open "http://${external_ip}/d/9HXuXojGk/fsi-pattern?orgId=1&refresh=1m"