Skip to content

Commit f819b6a

Browse files
committed
Need to commit changes for pushing to OpenShift, but only deploy to the dist branch for tags.
1 parent 9f06713 commit f819b6a

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ deploy:
2323
app: angular
2424
skip_cleanup: true
2525
on:
26-
branch: master-dist
26+
branch: master
2727
condition: $TRAVIS_REPO_SLUG = "patternfly/angular-patternfly"
2828

2929
notifications:

scripts/publish.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22

33
set -o errexit -o nounset
44

5-
if [ -z "$TRAVIS_TAG" -a "$TRAVIS_BRANCH" != "master" ]
6-
then
7-
echo "This commit was made against $TRAVIS_BRANCH and not the master or tag! Do not deploy!"
8-
exit 1
9-
fi
10-
115
# User info
126
git config user.name "Admin"
137
git config user.email "[email protected]"
@@ -20,7 +14,15 @@ git remote add upstream https://[email protected]/$TRAVIS_REPO_SLUG.git
2014
git add dist --force
2115
git commit -m "Added files generated by Travis build"
2216

23-
# Push to releases branch
17+
# Must commit changes for pushing to OpenShift, but
18+
# only deploy to the dist branch for tags.
19+
if [ -z "$TRAVIS_TAG" -a "$TRAVIS_BRANCH" != "master" ]
20+
then
21+
echo "This commit was made against $TRAVIS_BRANCH and not the master or tag! Do not deploy to $TRAVIS_BRANCH-dist"
22+
exit
23+
fi
24+
25+
# Push to dist branch
2426
EXISTING=`git ls-remote --heads https://github.com/"$TRAVIS_REPO_SLUG".git "$TRAVIS_BRANCH"-dist`
2527

2628
if [ -z "$TRAVIS_TAG" ]
@@ -35,5 +37,3 @@ then
3537
git push upstream $TRAVIS_BRANCH:$TRAVIS_BRANCH-dist --force -v
3638
fi
3739
fi
38-
39-
exit $?

0 commit comments

Comments
 (0)