forked from apache/rocketmq-site
-
Notifications
You must be signed in to change notification settings - Fork 0
/
push-site-to-master.sh
22 lines (17 loc) · 782 Bytes
/
push-site-to-master.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
if [ "$TRAVIS_REPO_SLUG" == "apache/rocketmq-site" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
echo -e "Publishing Apache RocketMQ site...\n"
rm -rf $HOME/rocketmq-site-latest
cp -R . $HOME/rocketmq-site-latest
cd $HOME
git config --global user.email "[email protected]"
git config --global user.name "travis-ci"
git clone --quiet --branch=asf-site https://${GH_TOKEN}@github.com/apache/rocketmq-site asf-site > /dev/null
cd asf-site
git rm -rf .
cp -Rf $HOME/rocketmq-site-latest/. .
git add -f .
git commit -m "Latest site on successful travis build $TRAVIS_BUILD_NUMBER auto-pushed to asf-site"
git push -fq origin asf-site > /dev/null
echo -e "Published rocketmq site to asf-site.\n"
fi