Skip to content

Commit d78836a

Browse files
authored
Merge pull request patternfly#266 from dlabrecq/PTNFLY-script-update
Added the ability to rebuild a previously created repo.
2 parents 2ac298b + a52b2ad commit d78836a

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

scripts/release.sh

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ default()
88
SCRIPT=`basename $0`
99
SCRIPT_DIR=`dirname $0`
1010
SCRIPT_DIR=`cd $SCRIPT_DIR; pwd`
11-
TMP_DIR="/tmp/$SCRIPT.$$"
11+
TMP_DIR="/tmp/patternfly-releases"
1212

1313
BOWER_JSON=bower.json
1414
PACKAGE_JSON=package.json
1515

1616
PTNFLY_REPO=https://github.com/patternfly/angular-patternfly.git
1717
PTNFLY_DIR="$TMP_DIR/angular-patternfly"
18-
VERIFY_DIR="$TMP_DIR/verify"
18+
VERIFY_DIR="$TMP_DIR/angular-patternfly-verify"
1919
}
2020

2121
build()
@@ -72,6 +72,14 @@ clean()
7272

7373
npm cache clean
7474
bower cache clean
75+
76+
# Remove for repo rebuild
77+
if [ -d node_modules ]; then
78+
rm -rf node_modules
79+
fi
80+
if [ -d lib ]; then
81+
rm -rf lib
82+
fi
7583
}
7684

7785
# Install dependencies
@@ -111,6 +119,8 @@ push()
111119
# Setup local repo
112120
setup_repo() {
113121
echo "*** Setting up local repo $PTNFLY_DIR"
122+
rm -rf $PTNFLY_DIR
123+
114124
mkdir -p $TMP_DIR
115125
cd $TMP_DIR
116126

@@ -129,24 +139,27 @@ cat <<- EEOOFF
129139
130140
Note: After changes are pushed, a PR will need to be created via GitHub.
131141
132-
sh [-x] $SCRIPT [-h|f] -v <version>
142+
sh [-x] $SCRIPT [-h|f|s] -v <version>
133143
134144
Example: sh $SCRIPT -v 3.7.0 -f
135145
136146
OPTIONS:
137147
h Display this message (default)
138148
f Force push to new repo branch (e.g., bump-v3.7.0)
149+
s Skip repo setup (e.g., to rebuild previously created repo)
139150
v The version number (e.g., 3.7.0)
140151
141152
EEOOFF
142153
}
143154

144155
verify()
145156
{
157+
echo "*** Verifying install"
158+
rm -rf $VERIFY_DIR
159+
146160
mkdir -p $VERIFY_DIR
147161
cd $VERIFY_DIR
148162

149-
echo "*** Verifying bower install"
150163
bower install $PTNFLY_DIR
151164
check $? "bower install failure"
152165
}
@@ -160,10 +173,11 @@ verify()
160173
exit 1
161174
fi
162175

163-
while getopts hfv c; do
176+
while getopts hfsv c; do
164177
case $c in
165178
h) usage; exit 0;;
166179
f) PUSH=1;;
180+
s) SETUP=1;;
167181
v) VERSION=$2; shift
168182
BRANCH=bump-v$VERSION;;
169183
\?) usage; exit 1;;
@@ -176,7 +190,11 @@ verify()
176190
fi
177191

178192
prereqs
179-
setup_repo
193+
194+
if [ -z "$SETUP" ]; then
195+
setup_repo
196+
fi
197+
180198
bump_bower
181199
bump_package
182200
clean

0 commit comments

Comments
 (0)