Allow API-only builds and deploy

This commit is contained in:
Joshua Boniface 2024-08-25 20:45:52 -04:00
parent e938140414
commit 10de85cce3
1 changed files with 7 additions and 0 deletions

View File

@ -13,6 +13,7 @@ else
fi
KEEP_ARTIFACTS=""
API_ONLY=""
PRIMARY_NODE=""
if [[ -n ${1} ]]; then
for arg in ${@}; do
@ -21,6 +22,10 @@ if [[ -n ${1} ]]; then
KEEP_ARTIFACTS="y"
shift
;;
-a|--api-only)
API_ONLY="y"
shift
;;
-p=*|--become-primary=*)
PRIMARY_NODE=$( awk -F'=' '{ print $NF }' <<<"${arg}" )
shift
@ -75,6 +80,7 @@ for HOST in ${HOSTS[@]}; do
ssh $HOST $SUDO systemctl restart pvcapid &>/dev/null
sleep 2
ssh $HOST $SUDO systemctl restart pvcworkerd &>/dev/null
if [[ -z ${API_ONLY} ]]; then
sleep 2
ssh $HOST $SUDO systemctl restart pvchealthd &>/dev/null
sleep 2
@ -85,6 +91,7 @@ for HOST in ${HOSTS[@]}; do
sleep 5
echo -n "."
done
fi
echo " done."
if [[ -n ${PRIMARY_NODE} && ${PRIMARY_NODE} == ${HOST} ]]; then
echo -n ">>> Setting node $HOST to primary coordinator state... "