Add error handling for netlify deployment

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2022-03-27 23:02:37 +02:00
parent 30620a60e6
commit 3b446a605d
2 changed files with 12 additions and 0 deletions

View file

@ -6,6 +6,12 @@
json=$(yarn netlify deploy --build --prod --json --message "${1:0:8}: $2")
if [ $? -ne 0 ]; then
echo "Error while executing netlify! Will try again without json..."
yarn netlify deploy --build --prod --message "${1:0:8}: $2"
exit 1
fi
echo "${json}"
url=$(echo "${json}" | jq -r .deploy_url)

View file

@ -6,6 +6,12 @@
json=$(yarn netlify deploy --build --context deploy-preview --alias "$1" --json --message "[#$1] $2")
if [ $? -ne 0 ]; then
echo "Error while executing netlify! Will try again without json..."
yarn netlify deploy --build --context deploy-preview --alias "$1" --message "[#$1] $2"
exit 1
fi
echo "${json}"
url=$(echo "${json}" | jq -r .deploy_url)