Skip to content
Snippets Groups Projects

Introduce automated deploy to WP.org

Merged Erick Hitter requested to merge add/wp-org-deploy into master
Files
2
+ 5
4
@@ -39,7 +39,7 @@ if [[ -z "$CI" ]]; then
fi
if [[ -z "$WP_ORG_USERNAME" ]]; then
echo "WordPress.org password not set" 1>&2
echo "WordPress.org username not set" 1>&2
exit 1
fi
@@ -62,8 +62,8 @@ echo "ℹ︎ PLUGIN_SLUG is $PLUGIN_SLUG"
echo "ℹ︎ PLUGIN_VERSION is $PLUGIN_VERSION"
SVN_URL="https://plugins.svn.wordpress.org/${PLUGIN_SLUG}/"
SVN_DIR="/tmp/svn-${PLUGIN_SLUG}"
TMP_DIR="/tmp/git-archive"
SVN_DIR="$CI_BUILDS_DIR/svn-${PLUGIN_SLUG}"
TMP_DIR="$CI_BUILDS_DIR/git-archive"
# Checkout just trunk for efficiency
# Tagging will be handled on the SVN level
@@ -93,6 +93,7 @@ if [[ ! -e "$CI_PROJECT_DIR/.gitattributes" ]]; then
fi
# This will exclude everything in the .gitattributes file with the export-ignore flag
mkdir "$TMP_DIR"
git archive HEAD | tar x --directory="$TMP_DIR"
cd "$SVN_DIR"
@@ -119,7 +120,7 @@ svn status
# Stop here unless this is a merge into master.
if [[ -z "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" || "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" != "master" ]]; then
echo "︎ EXITING before commit step as this is the '${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}' branch, not the 'master' branch." 1>&2
echo "𝘅︎ EXITING before commit step as this is the '${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}' branch, not the 'master' branch." 1>&2
exit 0
fi
Loading