-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
executable file
·60 lines (57 loc) · 2.13 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
#!/bin/bash
env=$1
stack=$2
test="sieni"
qa="pallero"
prod="sade"
if [ "$#" -eq 2 ]; then
if lein test; then
lein with-profile uberjar uberjar
cd cdk || exit $?
if [ "$stack" == "amis" ]; then
if [ "$env" == "$prod" ]; then
aws-vault exec oph-prod -- cdk deploy sade-services-heratepalvelu
elif [ "$env" == "$qa" ]; then
aws-vault exec oph-dev -- cdk deploy pallero-services-heratepalvelu
elif [ "$env" == "$test" ]; then
aws-vault exec oph-dev -- cdk deploy sieni-services-heratepalvelu
else
echo "hyväksytyt env parametrit: sieni, pallero, sade"
fi
elif [ "$stack" == "tep" ]; then
if [ "$env" == "$prod" ]; then
aws-vault exec oph-prod -- cdk deploy sade-services-heratepalvelu-tep
elif [ "$env" == "$qa" ]; then
aws-vault exec oph-dev -- cdk deploy pallero-services-heratepalvelu-tep
elif [ "$env" == "$test" ]; then
aws-vault exec oph-dev -- cdk deploy sieni-services-heratepalvelu-tep
else
echo "hyväksytyt env parametrit: sieni, pallero, sade"
fi
elif [ "$stack" == "tpk" ]; then
if [ "$env" == "$prod" ]; then
aws-vault exec oph-prod -- cdk deploy sade-services-heratepalvelu-tpk
elif [ "$env" == "$qa" ]; then
aws-vault exec oph-dev -- cdk deploy pallero-services-heratepalvelu-tpk
elif [ "$env" == "$test" ]; then
aws-vault exec oph-dev -- cdk deploy sieni-services-heratepalvelu-tpk
else
echo "hyväksytyt env parametrit: sieni, pallero, sade"
fi
elif [ "$stack" == "teprah" ]; then
if [ "$env" == "$prod" ]; then
aws-vault exec oph-prod -- cdk deploy sade-services-heratepalvelu-teprah
elif [ "$env" == "$qa" ]; then
aws-vault exec oph-dev -- cdk deploy pallero-services-heratepalvelu-teprah
elif [ "$env" == "$test" ]; then
aws-vault exec oph-dev -- cdk deploy sieni-services-heratepalvelu-teprah
else
echo "hyväksytyt env parametrit: sieni, pallero, sade"
fi
else
echo "hyväksytyt stack parametrit: amis, tep, tpk, teprah"
fi
fi
else
echo "parametrit <env> <stack>"
fi