Skip to content

Commit 7180b02

Browse files
committed
Update deploy script to check version in constant
1 parent d6d1cd9 commit 7180b02

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

.svnignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ bin
88
phpunit.xml.dist
99
.travis.yml
1010
coverage
11+
.coveralls.yml

deploy.sh

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ SVNUSER="sparkpost" # your svn username
1818

1919
# Let's begin...
2020
echo ".........................................."
21-
echo
21+
echo
2222
echo "Preparing to deploy wordpress plugin"
23-
echo
23+
echo
2424
echo ".........................................."
25-
echo
25+
echo
2626

2727
# Check if subversion is installed before getting all worked up
2828
if ! which svn >/dev/null; then
@@ -35,15 +35,20 @@ NEWVERSION1=`grep "^Stable tag:" $GITPATH/readme.txt | awk -F' ' '{print $NF}'`
3535
echo "readme.txt version: $NEWVERSION1"
3636
NEWVERSION2=`grep "^Version:" $GITPATH/$MAINFILE | awk -F' ' '{print $NF}'`
3737
echo "$MAINFILE version: $NEWVERSION2"
38+
NEWVERSION3=`grep "^define('WPSP_PLUGIN_VERSION', '2.5.0');" $GITPATH/wordpress-sparkpost.php | awk -F"'" '{print $4}'`
39+
echo "$MAINFILE version constant : $NEWVERSION3"
3840

39-
if [ "$NEWVERSION1" != "$NEWVERSION2" ]; then echo "Version in readme.txt & $MAINFILE don't match. Exiting...."; exit 1; fi
41+
if [[ "$NEWVERSION1" != "$NEWVERSION2" || "$NEWVERSION2" != "$NEWVERSION3" ]]; then
42+
echo "Version in readme.txt, $MAINFILE (in comment or constant) don't match. Exiting....";
43+
exit 1
44+
fi
4045

4146
echo "Versions match in readme.txt and $MAINFILE. Let's proceed..."
4247

4348
if git show-ref --tags --quiet --verify -- "refs/tags/$NEWVERSION1"
44-
then
45-
echo "Version $NEWVERSION1 already exists as git tag. Exiting....";
46-
exit 1;
49+
then
50+
echo "Version $NEWVERSION1 already exists as git tag. Exiting....";
51+
exit 1;
4752
else
4853
echo "Git version does not exist. Let's proceed..."
4954
fi
@@ -60,7 +65,7 @@ echo "Pushing latest commit to origin, with tags"
6065
git push origin master
6166
git push origin master --tags
6267

63-
echo
68+
echo
6469
echo "Creating local copy of SVN repo ..."
6570
if [ -d $SVNPATH ]; then rm -rf $SVNPATH; fi
6671
svn co $SVNURL $SVNPATH

0 commit comments

Comments
 (0)