laconic-network-bootstrap/scripts/deployment-command.sh

26 lines
636 B
Bash
Raw Permalink Normal View History

2024-07-08 12:22:16 +00:00
#!/usr/bin/env bash
# Run a specified deployment subcommand on all nodes
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source ${SCRIPT_DIR}/lib.sh
usage="Usage: $0 <machine-name-prefix> <deployment-subcommand>"
if [[ -n "$1" ]]; then
machine_name_prefix=$1
else
echo ${usage}
exit 1
fi
if [[ -n "$2" ]]; then
subcommand=$2
else
echo ${usage}
exit 1
fi
deployment_dir=${machine_name_prefix}-deployment
deployment_command="${so_command} deployment --dir ${deployment_dir} ${subcommand}"
run_on_all_nodes ${machine_name_prefix} "${deployment_command}"