-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathentrypoint.sh
executable file
·54 lines (38 loc) · 1.61 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
#!/bin/sh
set -eu
env_list=""
if [ -n "${INPUT_FIREBIRD_DATABASE:-}" ]; then
env_list="$env_list --env 'FIREBIRD_DATABASE=${INPUT_FIREBIRD_DATABASE}'"
fi
if [ -n "${INPUT_FIREBIRD_USER:-}" ]; then
env_list="$env_list --env 'FIREBIRD_USER=${INPUT_FIREBIRD_USER}'"
fi
if [ -n "${INPUT_FIREBIRD_PASSWORD:-}" ]; then
env_list="$env_list --env 'FIREBIRD_PASSWORD=${INPUT_FIREBIRD_PASSWORD}'"
fi
if [ -n "${INPUT_ISC_PASSWORD:-}" ]; then
env_list="$env_list --env 'ISC_PASSWORD=${INPUT_ISC_PASSWORD}'"
fi
if [ -n "${INPUT_TIMEZONE:-}" ]; then
env_list="$env_list --env 'TZ=${INPUT_TIMEZONE}'"
fi
if [ -n "${INPUT_ENABLE_LEGACY_CLIENT_AUTH:-}" ]; then
env_list="$env_list --env 'EnableLegacyClientAuth=${INPUT_ENABLE_LEGACY_CLIENT_AUTH}'"
fi
if [ -n "${INPUT_ENABLE_WIRE_CRYPT:-}" ]; then
env_list="$env_list --env 'EnableWireCrypt=${INPUT_ENABLE_WIRE_CRYPT}'"
fi
if [ -n "${INPUT_DATA_TYPE_COMPATIBILITY:-}" ]; then
env_list="$env_list --env 'DataTypeCompatibility=${INPUT_DATA_TYPE_COMPATIBILITY}'"
fi
docker_run="docker run --detach --name '${INPUT_CONTAINER_NAME:-firebirdsql}' --publish '${INPUT_PORT:-3050}:3050' $env_list 'jacobalberty/firebird:${INPUT_VERSION:-latest}'"
echo "# Creating FirebirdSQL Container: $docker_run"
sh -c "$docker_run"
echo "Waiting for ${INPUT_CONTAINER_NAME} to get ready..."
for ii in $(seq 15 -2 1) ; do
if [[ "$( docker container inspect -f '{{.State.Running}}' ${INPUT_CONTAINER_NAME} )" == "true" ]] ; then break ; fi
test ${ii} -le 1 && fail "Failed starting to ${INPUT_CONTAINER_NAME}!"
echo -n "." ; sleep ${ii}
done
exit 0
## end of script ##