Increment docker-stacks.sh

This commit is contained in:
Joey Hafner 2023-10-16 22:37:51 -07:00
parent 85f49f93a5
commit b7c7795890

View File

@ -1,5 +1,15 @@
function initialize {
USER="admin"
HOSTNAME=$(hostname)
STACKS_DIRECTORY="/home/$USER/homelab/$HOSTNAME/config"
echo "Initialized with:"
echo "USER=$USER"
echo "HOSTNAME=$HOSTNAME"
echo "STACKS_DIRECTORY=$STACKS_DIRECTORY"
}
function main { function main {
STACKS_DIRECTORY="/home/admin/homelab/fighter/config"
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case $1 in case $1 in
# parse global flags # parse global flags
@ -24,7 +34,7 @@ function main {
esac esac
done done
;; ;;
config*) COMMAND="config"; shift; config*) COMMAND="docker-compose config"; shift;
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case $1 in case $1 in
-n|--no-interpolate) COMMAND="$COMMAND --no-interpolate"; shift;; -n|--no-interpolate) COMMAND="$COMMAND --no-interpolate"; shift;;
@ -36,7 +46,7 @@ function main {
esac esac
done done
if [ ! $COMMAND ]; then if [ -z ${COMMAND+x} ]; then
echo "Error: no command specified" echo "Error: no command specified"
exit 1 exit 1
fi fi
@ -63,6 +73,5 @@ function main {
done done
} }
ARGS="$@" initialize
main "$@"
main $ARGS