From c5513a13c3d9ef26a80e2e7dcfa0f907072a38e1 Mon Sep 17 00:00:00 2001 From: mat ess Date: Sun, 4 Dec 2022 20:07:38 -0500 Subject: [PATCH] Revert "Remove --site option" This reverts commit 045f85cd2ba8f785d13e791c2a5cc517425ca4e2. --- script.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/script.sh b/script.sh index b0f1f7d..0dc2c55 100755 --- a/script.sh +++ b/script.sh @@ -41,10 +41,16 @@ then NETLIFY_DEPLOY_OPTIONS="${NETLIFY_DEPLOY_OPTIONS} --debug" fi -NETLIFY_AUTH="--auth $PLUGIN_TOKEN" -echo "> Deploying on Netlify..." && -echo "> (Using options $NETLIFY_DEPLOY_OPTIONS)" && -netlify deploy $NETLIFY_AUTH $NETLIFY_DEPLOY_OPTIONS --message "$DRONE_COMMIT_MESSAGE"; +if [ -n "$PLUGIN_SITE" ] +then + NETLIFY_SITE="--auth $PLUGIN_TOKEN --site $PLUGIN_SITE" + echo "> Deploying on Netlify…" && + echo "> (Using option $NETLIFY_DEPLOY_OPTIONS)" && + netlify deploy $NETLIFY_SITE $NETLIFY_DEPLOY_OPTIONS --message "$DRONE_COMMIT_MESSAGE"; +else + echo "> Error! site (site ID or name) and token are required" + exit 1 +fi rc=$?; if [[ $rc != 0 ]]