This repository has been archived by the owner on Jul 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathdeploy.sh
executable file
·123 lines (103 loc) · 4.36 KB
/
deploy.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#!/bin/bash
###########################################################################
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
###########################################################################
if [ -d "${PWD}/install" ]; then
THIS_DIR=$PWD
echo ""
echo "Welcome To StarThinker ( Google gTech )"
echo ""
echo "This utility will help you set up and manage long running recipes."
echo "If this is your first time running this script, select Full Setup."
echo ""
if [ ! -z "${BASH}" ]; then
echo ""
echo "------------------------------------------------------------------------------"
echo "This is a reference implementation only and not warrantied by Google."
echo ""
read -p "Do you acknowledge and wish to proceed (y/n)? " -n 1 -r
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]; then
source ${THIS_DIR}/install/config.sh;
source ${THIS_DIR}/install/worker.sh;
source ${THIS_DIR}/install/developer.sh;
source ${THIS_DIR}/install/enterprise.sh;
source ${THIS_DIR}/install/composer.sh;
echo ""
echo "----------------------------------------------------------------------"
echo "gTech StarThinker"
echo "----------------------------------------------------------------------"
echo ""
echo "Developer Menu"
echo "Sets up local environment to run StarThinker recipes from the command line. Most basic setup."
echo ""
echo ""
echo "Enterprise Setup Menu"
echo "Sets up a Google App Engine Instance web UI for multiple users and distributed jobs. Highly scalable team wide deployment."
echo ""
echo ""
echo "Composer Setup Menu"
echo "Sets up a Google Cloud Composer Instance for distributed jobs. Alternate scalable team wide deployment."
echo ""
echo ""
echo "Change Analytics Token"
echo "The UI deployment will track anonymous usage data, to disable, adjust the Google Analytics Token."
echo ""
main_done=0
main_options=("Developer Menu" "Enterprise Menu" "Composer Setup Menu" "Deploy Cloud Function" "Change gCloud User" "Change gCloud Project" "Setup Service Credentials" "Change User Credentials" "Change UI Credentials" "Change Analytics Token" "Change API Key" "Change Developer Token")
while (( !main_done ))
do
echo "----------------------------------------------------------------------"
echo "Main Menu"
echo "----------------------------------------------------------------------"
echo ""
PS3='Your Choice ( q = Quit ): '
select main_option in "${main_options[@]}"; do
case $REPLY in
1) setup_developer; break ;;
2) setup_enterprise; break ;;
3) setup_composer; break ;;
4) setup_cloud_function; break ;;
5) setup_gcloud "forced"; save_config; break ;;
6) setup_project "forced"; save_config; break ;;
7) setup_credentials_service "forced"; save_config; break ;;
8) setup_credentials_commandline "forced"; setup_credentials_user "forced"; save_config; break ;;
9) setup_credentials_ui "forced"; save_config; break ;;
10) setup_analytics "forced"; save_config; break ;;
11) setup_developer_token "forced"; save_config; break ;;
12) setup_api_key "forced"; save_config; break ;;
q) main_done=1; break;;
*) echo "What's that?" ;;
esac
done
echo ""
done
fi
else
echo ""
echo "This script require a bash shell."
echo "Run: /bin/bash"
echo "Then run this script again."
echo ""
fi
else
echo ""
echo "Directory starthinker not found."
echo "This utility must be run from the directory containing the starthinker directory."
echo "Please change directories and try again."
echo ""
fi