-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathentrypoint.sh
executable file
·74 lines (62 loc) · 1.73 KB
/
entrypoint.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
#!/bin/bash
function parseInputs {
# Required inputs
if [[ "${INPUT_SCEPTRE_SUBCOMMAND}" != "" ]]; then
sceptreSubcommand=${INPUT_SCEPTRE_SUBCOMMAND}
else
echo "Input sceptre_subcommand cannot be empty!"
exit 1
fi
# Optional inputs
sceptreVer='4.0.2'
if [[ "${INPUT_SCEPTRE_VERSION}" != "" ]]; then
sceptreVer=${INPUT_SCEPTRE_VERSION}
else
echo "Input sceptre_version cannot be empty!"
exit 1
fi
sceptreDir="."
if [[ -n "${INPUT_SCEPTRE_DIRECTORY}" ]]; then
sceptreDir=${INPUT_SCEPTRE_DIRECTORY}
fi
sceptreTroposphere=0
if [[ "${INPUT_SCEPTRE_TROPOSPHERE}" != "" ]]; then
if [[ "${INPUT_SCEPTRE_TROPOSPHERE}" == "false" ]]; then
sceptreTroposphere=0
elif [[ "${INPUT_SCEPTRE_TROPOSPHERE}" == "true" ]]; then
sceptreTroposphere=1
else
echo "Invalid input for sceptre_troposphere, must be 'true' or 'false'"
exit 1
fi
else
echo "Input sceptre_troposphere cannot be empty!"
exit 1
fi
sceptreTroposphereVer='4.3.2'
if [[ "${INPUT_SCEPTRE_TROPOSPHERE_VERSION}" != "" ]]; then
sceptreTroposphereVer=${INPUT_SCEPTRE_TROPOSPHERE_VERSION}
else
echo "Input sceptre_troposphere_version cannot be empty!"
exit 1
fi
}
function installDeps {
if [[ "${sceptreTroposphere}" == 1 ]]; then
echo "Installing Troposphere"
pip install --no-input troposphere==$sceptreTroposphereVer
fi
echo "Installing Sceptre"
pip install --no-input sceptre==$sceptreVer
if [[ "${INPUT_SCEPTRE_PLUGINS}" != "" ]]; then
echo "Installing Sceptre plugins"
pip install --no-input ${INPUT_SCEPTRE_PLUGINS}
fi
}
function main {
parseInputs
installDeps
cd ${GITHUB_WORKSPACE}/${sceptreDir}
sceptre $sceptreSubcommand
}
main "${*}"