jean-cloud-services/provisioning/roles/deploy_all/files/bin/deploy_user.sh
2023-12-20 18:06:09 +01:00

27 lines
368 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
if [ "$#" -ne 1 ] || [ -z "$1" ] ; then
echo "Usage: $0 <service_name>"
exit 1
fi
service="$1"
user_file="/docker/$service/deploy_user.sh"
env_file="/docker/$service/.env"
if [ ! -f "$user_file" ] ; then
echo "No such file: $user_file"
exit 1
fi
if [ -f "$env_file" ] ; then
set -a
source "$env_file"
set +a
fi
"$user_file"