2017-05-25 16:00:07 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -o errexit -o nounset
|
|
|
|
|
2017-05-25 16:15:31 +02:00
|
|
|
if [ "$TRAVIS_BRANCH" != "master" ]
|
2017-05-25 16:00:07 +02:00
|
|
|
then
|
|
|
|
echo "This commit was made against $TRAVIS_BRANCH and not master! No deploy!"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
rev=$(git rev-parse --short HEAD)
|
|
|
|
|
|
|
|
mkdir deploy
|
|
|
|
cd deploy
|
|
|
|
|
|
|
|
git init
|
2017-07-04 02:23:23 +02:00
|
|
|
git config --global user.name $GH_USER
|
|
|
|
git config --global user.email $GH_EMAIL
|
2017-05-25 16:00:07 +02:00
|
|
|
|
2017-05-25 17:53:53 +02:00
|
|
|
git remote add upstream "https://$GH_TOKEN@github.com/toddmotto/public-apis.git"
|
2017-05-25 16:00:07 +02:00
|
|
|
git fetch upstream
|
|
|
|
git reset upstream/master
|
|
|
|
|
2017-05-25 16:08:54 +02:00
|
|
|
mv ../../json .
|
2017-05-25 16:00:07 +02:00
|
|
|
|
2017-05-25 16:08:54 +02:00
|
|
|
git add json/
|
2017-05-25 17:00:51 +02:00
|
|
|
git commit -m "rebuild JSON at ${rev}" -m "[ci skip]"
|
2017-05-25 16:00:07 +02:00
|
|
|
git push upstream HEAD:master
|
|
|
|
|