Change prod flag to avoid erros on new projects

All new projects are created as "locked" by default so this allow their
deployment. Additionally, a moreh helpful error message is added when
NETLIFY_ACCOUNT cannot be found
Fixes #1918

Signed-off-by: Marcos Lilljedahl <marcosnils@gmail.com>
This commit is contained in:
Marcos Lilljedahl 2022-03-29 15:16:06 -03:00
parent 23ab465c45
commit 5e150c8cfc

View File

@ -15,6 +15,7 @@ create_site() {
# shellcheck disable=SC2181
if [ $? -ne 0 ]; then
>&2 echo "Error creating site [${NETLIFY_SITE_NAME}] for account [${NETLIFY_ACCOUNT}]"
cat body >&2
exit 1
fi
@ -47,7 +48,7 @@ netlify link --id "$site_id"
netlify deploy \
--build \
--site="$site_id" \
--prodIfUnlocked |
--prod |
tee /tmp/stdout
url="$(grep </tmp/stdout Website | grep -Eo 'https://[^ >]+' | head -1)"