Files
public-apis/build/deploy.sh
T

29 lines
566 B
Bash
Raw Normal View History

2017-05-25 10:00:07 -04:00
#!/bin/bash
set -o errexit -o nounset
2017-05-25 10:15:31 -04:00
if [ "$TRAVIS_BRANCH" != "master" ]
2017-05-25 10:00:07 -04: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
git config --global user.name $GH_USER
git config --global user.email $GH_EMAIL
2017-05-25 10:00:07 -04:00
2017-05-25 11:53:53 -04:00
git remote add upstream "https://$GH_TOKEN@github.com/toddmotto/public-apis.git"
2017-05-25 10:00:07 -04:00
git fetch upstream
git reset upstream/master
mv ../../json .
2017-05-25 10:00:07 -04:00
git add json/
git commit -m "rebuild JSON at ${rev}" -m "[ci skip]"
2017-05-25 10:00:07 -04:00
git push upstream HEAD:master