Files
swift-hpa/docker/entrypoint.sh
Michael Housh f7f3ac5dc7
All checks were successful
CI / Run Tests (push) Successful in 1m27s
Build docker images / docker (push) Successful in 6m45s
feat: Updates Dockerfile, WIP
2025-11-07 15:16:05 -05:00

23 lines
457 B
Bash

#!/bin/bash
# Allows to attach to a shell inside the container, or run ansbile commands,
# otherwise run the 'hpa' script with the given arguments.
#
while [[ $# -gt 0 ]]; do
if [[ $1 == "/bin/bash" ]] || [[ $1 == "bash" ]]; then
shift
/bin/bash "$@"
exit $?
elif [[ $1 == "/bin/sh" ]] || [[ $1 == "sh" ]]; then
shift
/bin/sh "$@"
exit $?
elif [[ $1 =~ ^ansible ]]; then
exec "$@"
exit $?
else
/usr/local/bin/hpa "$@"
fi
shift
done