atst/script/include/run_alpine_setup
dandds beabd2ce72 Remove the scriptz submodule and hard-commit the files.
The submodule is a leftover from when this project was intended to work
as a series of microservices. It was meant to provide common
functionality to the builds for every microservice. That's no longer the
case, and the submodule is a pain-point both in on-boarding new
developers and running the Docker build.
2019-07-14 16:01:13 -04:00

33 lines
872 B
Plaintext

# run_alpine_setup: Install basic system requirements for an app to run
# Load alpine setup functions
source ./script/include/alpine_setup_functions.inc.sh
## Set option defaults
# If GROUP information is incomplete, use the default one
if [ -z "${APP_GROUP+is_set}" ] || \
[ -z "${APP_GID+is_set}" ]; then
APP_GROUP="atat"
APP_GID="8000"
fi
# If USER information is incomplete, error out
if [ -z "${APP_USER+is_set}" ] || \
[ -z "${APP_UID+is_set}" ]; then
echo "ERROR: Missing app user information! Received: ${APP_USER}:${APP_UID}"
exit 1
fi
## Main
update_system_packages
install_package "bash"
install_package "dumb-init"
if [ ! -z "${ADDITIONAL_PACKAGES+is_set}" ]; then
for package in ${ADDITIONAL_PACKAGES}
do
install_package "${package}"
done
fi
add_group "${APP_GROUP}" "${APP_GID}"
add_user "${APP_USER}" "${APP_GROUP}" "${APP_UID}"