-
Notifications
You must be signed in to change notification settings - Fork 12
/
entrypoint.sh
48 lines (41 loc) · 920 Bytes
/
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
#!/bin/bash -l
set -e
env_str=""
if [ -n "$INPUT_ENV" ]; then
arr=(${INPUT_ENV})
for e in "${arr[@]}"
do
env_str+=" --env "
env_str+='"'$e'"'
done
fi
env_files_str=""
if [ -n "$INPUT_ENV_FILES" ]; then
arr=(${INPUT_ENV_FILES})
for e in "${arr[@]}"
do
env_files_str+=" --env-file "
env_files_str+='"'$e'"'
done
fi
buildpacks=""
if [ -n "$INPUT_BUILDPACKS" ]; then
arr=(${INPUT_BUILDPACKS})
for p in "${arr[@]}"
do
buildpacks+=" --buildpack "
buildpacks+='"'$p'"'
done
fi
publish=""
if [ -n "$INPUT_PUBLISH" ]; then
publish="--publish"
fi
command="pack build ${INPUT_IMAGE}:${INPUT_TAG} ${env_str} ${env_files_str} --path ${INPUT_PATH} ${buildpacks} --builder ${INPUT_BUILDER} ${publish}"
echo "command=${command}" >> $GITHUB_OUTPUT
if [ "$INPUT_DEBUG_MODE" = "true" ]; then
echo "Running in debug mode"
echo "command = ${command}"
else
sh -c "${command}"
fi