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