diff --git a/README.md b/README.md index 08c6f29837d1c6336419ec099901d2f737e09f43..27f5aac04ec0cafa02e2f0c43f47abbeebe655ac 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ Set the following environment variables in the GitLab project's configuration: * `PLUGIN_VERSION` - version to tag * `WP_ORG_RELEASE_REF` - git commit ref (branch or tag) to use for release * `WP_ORG_ASSETS_DIR` - directory name, relative to repo root, where screenshots and other static assets are held +* `WP_ORG_DEPLOY_SKIP` - set to `1` to skip the deploy without failing the job ### Alternate loading method diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 477ed8648aa51c8aca42b2de31ddbfe95b8b764b..aec400df4c3bd32eeb42a329733cafc2b669f7f3 100644 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -16,13 +16,19 @@ function cleanup() { # Provide a basic version identifier, particularly since this script # is usually accessed via CDN. -echo "ℹ︎ WP-ORG-PLUGIN-DEPLOY VERSION: 2019051201" +echo "ℹ︎ WP-ORG-PLUGIN-DEPLOY VERSION: 2022070901" if [[ -z "$CI" ]]; then echo "ð˜…︎ Script is only to be run by GitLab CI" 1>&2 exit 1 fi +# Allow deploy to be skipped if desired. +if [[ "1" == "$WP_ORG_DEPLOY_SKIP" ]]; then + echo "ℹ︎ WordPress.org deploy skipped due to WP_ORG_DEPLOY_SKIP variable" 1>&2 + exit 0 +fi + # Ensure certain environment variables are set # IMPORTANT: while access to secrets is restricted in the GitLab UI, # they are by necessity provided as plaintext in the context of this script,