Skip to content

Commit

Permalink
Release script: update list of files that ship with each relea… (#12832)
Browse files Browse the repository at this point in the history
* Add more files to svnignore as we don't need them on prod

* Require Bash 4 to run the deploy to SVN script

.svnignore uses the ** pattern to match any subdirectory, but that pattern
is only supported from Bash 4, with globstar.

Let's require release leads to use a recent version of Bash, or install it if they don't have it yet.

* Do not ship package tests and readme files

* Add more package files to list of files excluded from the release

Co-Authored-By: Igor Zinovyev <[email protected]>
  • Loading branch information
jeherve and zinigor authored Jun 24, 2019
1 parent 139eb53 commit ee0fcec
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .svnignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ renovate.json
bin/phpcs-whitelist.js
bin/pre-commit-hook.js
bin/release-package.php
css/*.css.map
docs
tests
scss
tools
vendor/bin
vendor/dealerdirect
Expand All @@ -29,6 +31,11 @@ vendor/sirbrillig
vendor/squizlabs
vendor/wp-coding-standards
vendor/automattic/jetpack-autoloader
vendor/automattic/**/tests/
vendor/automattic/**/README.md
vendor/automattic/**/phpunit.xml
vendor/automattic/**/phpunit.xml.dist
vendor/automattic/**/composer.json
composer.lock
package.json
gulpfile.js
Expand Down
15 changes: 14 additions & 1 deletion tools/deploy-to-svn.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
#!/bin/bash
#!/usr/bin/env bash

# This script requires Bash 4+, since we want a version of Bash that supports globstar.
if [ -z "${BASH_VERSINFO}" ] || [ -z "${BASH_VERSINFO[0]}" ] || [ ${BASH_VERSINFO[0]} -lt 4 ]; then
echo "This script requires Bash version >= 4."
read -p "Do you want to install it on your system with Homebrew? [y/N]" -n 1 -r
if [[ $REPLY != "y" && $REPLY != "Y" ]]; then
exit 1;
else
brew install bash 2>/dev/null
echo "Done!"
fi
fi

if [ $# -eq 0 ]; then
echo 'Usage: `./deploy-to-svn.sh <tag | HEAD>`'
Expand Down Expand Up @@ -69,6 +81,7 @@ echo "Done!"

echo "Purging paths included in .svnignore"
# check .svnignore
shopt -s globstar # Support globs.
for file in $( cat "$JETPACK_GIT_DIR/.svnignore" 2>/dev/null ); do
rm -rf $JETPACK_SVN_DIR/trunk/$file
done
Expand Down

0 comments on commit ee0fcec

Please sign in to comment.