forked from patternfly/patternfly-org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish.sh
30 lines (22 loc) · 843 Bytes
/
publish.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#/bin/sh
# This script is called from .travis.yml, upon a successful build, and commits
# generated files to a seperate branch. Note that this script depends on
# AUTH_TOKEN being set via Travis CI configuration.
set -o errexit -o nounset
if [ "$TRAVIS_BRANCH" != "master" ]
then
echo "This commit was made against the $TRAVIS_BRANCH and not the master! Do not deploy!"
exit 0
fi
# User info
git config --global user.name "Admin"
git config --global user.email "patternfly@redhat.com"
# Add upstream authentication token
git remote add upstream https://$AUTH_TOKEN@github.com/patternfly/patternfly-org.git
git fetch
# Commit generated files
git add source/assets/css source/components --force
git commit -m "Added files generated by Travis build"
# Push to remote branch
git push upstream $TRAVIS_BRANCH:releases --force
exit $?