zigbee2mqtt/.travis/update-wiki.sh

26 lines
623 B
Bash
Raw Normal View History

2018-04-26 10:46:00 -07:00
#!/bin/sh -e
2018-04-26 10:40:44 -07:00
setup_git() {
git config --global user.email "travis@travis-ci.org"
git config --global user.name "Travis CI"
}
update_wiki() {
rm -rf zigbee2mqtt.wiki
git clone https://${GH_TOKEN}@github.com/Koenkk/zigbee2mqtt.wiki.git
npm run docgen zigbee2mqtt.wiki
cd zigbee2mqtt.wiki
2018-04-26 11:00:23 -07:00
git add -A
git commit -m "Travis CI: update wiki"
2018-04-26 10:40:44 -07:00
git push origin
}
2018-04-26 10:56:00 -07:00
# Only update wiki if on master branch and not pull request
if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]
then
setup_git
update_wiki
else
echo "Not updating wiki, triggered by pull request or not on master branch"
fi