echo"Unable to pull any previous deployments for redeployment"
return1
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 \
--silent \
--output "/dev/null"\
-H "Authorization: Bearer $VERCEL_API_KEY"\
-H "Content-Type: application/json"\
-d "{
"deploymentId": $latest_id,
}"
-d "{ \"deploymentId\": \"${latest_id}\" }"
)
echo$redeploy_res
echo"${redeploy_res}"
}
# Check each module's accessibility
@ -136,13 +137,13 @@ done
# Determine overall status and update Instatus component
if((status==0));then
echo"All modules are operational."
# set to
# set to
update_component_status "OPERATIONAL"
echo"LATEST_REDEPLOY_FAILED=0" >> $GITHUB_ENV
echo"LATEST_REDEPLOY_FAILED=0" >> "${GITHUB_ENV}"
else
echo"The following modules have issues: ${failures[*]}"
# check if all modules are down
# check if all modules are down
if((${#failures[@]}==${#modules[@]}));then
update_component_status "MAJOROUTAGE"
else
@ -152,7 +153,7 @@ else
# Create a new incident
incident_id=$(create_incident)
echo"Created incident with ID: $incident_id"
# If a module is down, force a reployment to try getting things back online
# ASAP
status_code=$(force_redeploy_registry)
@ -167,7 +168,7 @@ else
# 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