Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ default()
SCRIPT=`basename $0`
SCRIPT_DIR=`dirname $0`
SCRIPT_DIR=`cd $SCRIPT_DIR; pwd`
TMP_DIR="/tmp/$SCRIPT.$$"
TMP_DIR="/tmp/patternfly-releases"

BOWER_JSON=bower.json
PACKAGE_JSON=package.json

PTNFLY_REPO=https://github.com/patternfly/angular-patternfly.git
PTNFLY_DIR="$TMP_DIR/angular-patternfly"
VERIFY_DIR="$TMP_DIR/verify"
VERIFY_DIR="$TMP_DIR/angular-patternfly-verify"
}

build()
Expand Down Expand Up @@ -72,6 +72,14 @@ clean()

npm cache clean
bower cache clean

# Remove for repo rebuild
if [ -d node_modules ]; then
rm -rf node_modules
fi
if [ -d lib ]; then
rm -rf lib
fi
}

# Install dependencies
Expand Down Expand Up @@ -111,6 +119,8 @@ push()
# Setup local repo
setup_repo() {
echo "*** Setting up local repo $PTNFLY_DIR"
rm -rf $PTNFLY_DIR

mkdir -p $TMP_DIR
cd $TMP_DIR

Expand All @@ -129,24 +139,27 @@ cat <<- EEOOFF

Note: After changes are pushed, a PR will need to be created via GitHub.

sh [-x] $SCRIPT [-h|f] -v <version>
sh [-x] $SCRIPT [-h|f|s] -v <version>

Example: sh $SCRIPT -v 3.7.0 -f

OPTIONS:
h Display this message (default)
f Force push to new repo branch (e.g., bump-v3.7.0)
s Skip repo setup (e.g., to rebuild previously created repo)
v The version number (e.g., 3.7.0)

EEOOFF
}

verify()
{
echo "*** Verifying install"
rm -rf $VERIFY_DIR

mkdir -p $VERIFY_DIR
cd $VERIFY_DIR

echo "*** Verifying bower install"
bower install $PTNFLY_DIR
check $? "bower install failure"
}
Expand All @@ -160,10 +173,11 @@ verify()
exit 1
fi

while getopts hfv c; do
while getopts hfsv c; do
case $c in
h) usage; exit 0;;
f) PUSH=1;;
s) SETUP=1;;
v) VERSION=$2; shift
BRANCH=bump-v$VERSION;;
\?) usage; exit 1;;
Expand All @@ -176,7 +190,11 @@ verify()
fi

prereqs
setup_repo

if [ -z "$SETUP" ]; then
setup_repo
fi

bump_bower
bump_package
clean
Expand Down