-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.sh
executable file
·51 lines (35 loc) · 1.45 KB
/
setup.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
40
41
42
43
44
45
46
47
48
49
50
51
if [ -z "$PROJECT_ID" ]; then
PROJECT_ID=$(gcloud info --format='value(config.project)')
fi
if [ -z "$PROJECT_ID" ]; then
echo "PROJECT_ID must be specified."
exit 1
fi
set_dummy_git_config_values() {
git config --global user.name "$USER"
git config --global user.email "[email protected]"
}
~/spinnaker-for-gcp/scripts/manage/check_git_config.sh || set_dummy_git_config_values
~/spinnaker-for-gcp/scripts/manage/check_cluster_config.sh
~/canary-workshop/prometheus/install_prometheus.sh
~/canary-workshop/build_and_publish_image.sh
~/spinnaker-for-gcp/scripts/manage/connect_unsecured.sh
export DIGEST=$(gcloud container images list-tags --project $PROJECT_ID \
gcr.io/$PROJECT_ID/sample-app --filter "tags:latest" --format json \
| jq -r .[0].digest)
~/canary-workshop/deploy_resources.sh
~/canary-workshop/kayenta/configure_prometheus_integration.sh
gcloud source repos create sample-app --project $PROJECT_ID
mkdir -p ~/$PROJECT_ID
rm -rf ~/$PROJECT_ID/sample-app
gcloud source repos clone sample-app ~/$PROJECT_ID/sample-app --project $PROJECT_ID
cp -R ~/canary-workshop/sample-app/* ~/$PROJECT_ID/sample-app
cd ~/$PROJECT_ID/sample-app
git add .
git commit -m 'Initial commit.'
git push
gcloud alpha builds triggers create cloud-source-repositories \
--repo sample-app --branch-pattern ^master$ \
--build-config cloudbuild.yaml \
--description "Build on push to master" --project $PROJECT_ID
~/canary-workshop/prometheus/expose_prometheus.sh