27 lines
368 B
Bash
27 lines
368 B
Bash
|
#!/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"
|