-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild-command.sh
69 lines (62 loc) · 1.71 KB
/
build-command.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
#!/bin/bash
keys="$(grep -A2 'hudl_farm' ~/.aws/credentials | sed -n -e 's/aws_access_key_id=\([A-Z]*\)/--accesskey \1/p' -e 's/aws_secret_access_key=\([A-Z0-9a-z]*\)/ --secretkey \1/p' | sed '/\n$/!N;s/\n//')"
command="dotnet run"
case "$1" in
find)
command+=" find"
;;
reboot)
command+=" reboot"
;;
*)
echo $"Usage $0 {find|reboot} {stream|stream-med|stream-lrg|phoenix-reel-concat|phoenix-html-effects|phoenix-timeline-item} {use1|apse2|euw1}"
exit 1
esac
command+=" $keys "
if [[ $2 =~ stream-* ]]; then
command+="--securityGroup prod-streamworker"
elif [ "$2" = "phoenix-reel-concat" ]; then
command+="--securityGroup prod-phoenix-reel-concat"
elif [ "$2" = "phoenix-timeline-item" ]; then
command+="--securityGroup prod-phoenix-timeline-item"
elif [ "$2" = "phoenix-html-effects" ]; then
command+="--securityGroup prod-phoenix-html-effects"
fi
case "$2" in
stream-lrg)
command+="-lrg --name prod-farm-stream-lrg"
;;
stream-med)
command+="-med --name prod-farm-stream-med"
;;
stream)
command+=" --name prod-farm-stream"
;;
phoenix-reel-concat)
command+=" --name prod-farm-phoenix-reel-concat"
;;
phoenix-html-effects)
command+=" --name prod-farm-phoenix-html-effects"
;;
phoenix-timeline-item)
command+=" --name prod-farm-phoenix-timeline-item"
;;
*)
echo $"Usage $0 {find|reboot} {stream|stream-med|stream-lrg|phoenix-reel-concat|phoenix-html-effects|phoenix-timeline-item} {use1|apse2|euw1}"
exit 1
esac
case "$3" in
apse2)
command+="-apse2 --region ap-southeast-2"
;;
euw1)
command+="-euw1 --region eu-west-1"
;;
use1)
;;
*)
echo $"Usage $0 {find|reboot} {stream|stream-med|stream-lrg|phoenix-reel-concat|phoenix-html-effects|phoenix-timeline-item} {use1|apse2|euw1}"
exit 1
esac
echo "$command"
exit 0