echo"Unable to pull any previous deployments for redeployment"
echo"Unable to pull any previous deployments for redeployment"
return1
return1
fi
fi
localredeploy_res=$(curl -X POST "https://api.vercel.com/v13/deployments?forceNew=1&skipAutoDetectionConfirmation=1&slug=$VERCEL_TEAM_SLUG&teamId=$VERCEL_TEAM_ID"\
local redeploy_res
redeploy_res=$(curl -X POST "https://api.vercel.com/v13/deployments?forceNew=1&skipAutoDetectionConfirmation=1&slug=$VERCEL_TEAM_SLUG&teamId=$VERCEL_TEAM_ID"\
--fail \
--fail \
--silent \
--silent \
--output "/dev/null"\
--output "/dev/null"\
-H "Authorization: Bearer $VERCEL_API_KEY"\
-H "Authorization: Bearer $VERCEL_API_KEY"\
-H "Content-Type: application/json"\
-H "Content-Type: application/json"\
-d "{
-d "{ \"deploymentId\": \"${latest_id}\" }"
"deploymentId": $latest_id,
}"
)
)
echo$redeploy_res
echo"${redeploy_res}"
}
}
# Check each module's accessibility
# Check each module's accessibility
@ -139,7 +140,7 @@ if (( status == 0 )); then
# set to
# set to
update_component_status "OPERATIONAL"
update_component_status "OPERATIONAL"
echo"LATEST_REDEPLOY_FAILED=0" >> $GITHUB_ENV
echo"LATEST_REDEPLOY_FAILED=0" >> "${GITHUB_ENV}"
else
else
echo"The following modules have issues: ${failures[*]}"
echo"The following modules have issues: ${failures[*]}"
# check if all modules are down
# check if all modules are down
@ -167,7 +168,7 @@ else
# don't keep running the script over and over again. Note that even if a
# don't keep running the script over and over again. Note that even if a
# re-deployment succeeds, that doesn't necessarily mean that everything is
# re-deployment succeeds, that doesn't necessarily mean that everything is