-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgame.sh
executable file
·179 lines (146 loc) · 4.27 KB
/
game.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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
#!/usr/bin/env bash
# Much of this below was initially adapted from an answer on an Ask Ubuntu question found here:
# https://askubuntu.com/questions/1705/how-can-i-create-a-select-menu-in-a-shell-script
TERMINAL=$(tty)
HEIGHT=15
WIDTH=78
BACKTITLE="Choose Your Own DevOps"
TITLE="The DevOps Simulator"
function menu () {
dialog --backtitle "$BACKTITLE" \
--title "$TITLE" \
--menu "$MENU" \
$HEIGHT $WIDTH $CHOICE_HEIGHT \
"${OPTIONS[@]}" \
2>&1 >$TERMINAL
}
function intro () {
if ! command -v dialog &> /dev/null
then
printf "\ndialog could not be found, please install.\nhttps://github.com/ryanmaclean/choose_devops#pre-requisites\n\n"
exit
fi
dialog --clear \
--backtitle "$BACKTITLE" \
--title "WELCOME EMAIL" "$@" \
--msgbox "Welcome to ACME Corp!
We're so happy you could start a week early!
We just got approval on our hiring spend, but didn't want to
start bothering people on LinkedIn until you made some platform
decisions to help us with our search.
Can you get these back to us by the end of the day?
I know this is your first Lead role since being a senior engineer,
but we're sure you're going to nail it!
Besides, everyone else who applied for the position wanted
double what you were asking, so it's win-win, right?" 0 0
}
function infra () {
CHOICE_HEIGHT=4
MENU="Choose one of the following paths for your infrastructure:"
OPTIONS=(1 "On-Prem"
2 "Cloud-Based"
3 "Hybrid Cloud"
4 "Multi-Cloud")
INFRA=$(menu)
# Sample of choice to make after storing answer
case $INFRA in
1)
echo "You chose Option 1"
;;
2)
echo "You chose Option 2"
;;
3)
echo "You chose Option 3"
;;
4)
echo "You chose Option 4"
;;
esac
}
function arch () {
CHOICE_HEIGHT=5
MENU="Choose the architecture that is going to be your primary platform:"
OPTIONS=(1 "X86-64"
2 "ARM"
3 "RISC"
4 "MIPS"
5 "Power")
ARCH=$(menu)
}
function email_reply () {
dialog --sleep 1 \
--backtitle "$BACKTITLE" \
--title "WELCOME EMAIL" "$@" \
--title "Reply from Talent Development" "$@" \
--msgbox "Hey thanks for getting back to us so quickly!
I pushed out a job req. for another Lead to help you, one for a
VP and a desktop support technician.
Wasn't sure what you meant about \"CI/CD\" so I just wrote down
what we used at my last place: Team Foundation Server - same thing,
right?" 0 0
}
function cloud () {
CHOICE_HEIGHT=7
MENU="Please select from one or more of the most popular cloud providers:"
OPTIONS=(1 "AWS"
2 "GCP"
3 "Azure"
4 "AliCloud"
5 "Oracle"
6 "IBM Cloud Services"
7 "Salesforce")
CLOUD=$(menu)
}
function database () {
CHOICE_HEIGHT=11
MENU="Please select your primary datastore:"
OPTIONS=(1 "MySQL"
2 "MariaDB"
3 "PostgreSQL"
4 "Oracle DB"
5 "IBM DB2"
6 "Microsoft SQL Server"
7 "Cassandra"
8 "HBase"
9 "Redis"
10 "Elasticsearch"
11 "Mongo")
DATABASE=$(menu)
}
function language () {
CHOICE_HEIGHT=20
MENU="Please select your primary programming language:"
OPTIONS=(1 "Javascript"
2 "PHP"
3 "Ruby"
4 "Python"
5 "C#"
6 "C++"
7 "Java"
8 "R"
9 "Objective-C"
10 "Swift"
11 "Kotlin"
12 "Typescript"
13 "Go"
14 "Rust"
15 "Scala"
16 "Dart"
17 "Lua"
18 "Erlang"
19 "Perl"
20 "Haskell")
LANGUAGE=$(menu)
}
function main () {
intro
infra
arch
cloud
language
database
email_reply
clear
}
main