You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
551 B

  1. #!/bin/bash
  2. set -o errexit -o nounset
  3. if [ "$TRAVIS_BRANCH" != "master" ]
  4. then
  5. echo "This commit was made against $TRAVIS_BRANCH and not master! No deploy!"
  6. exit 0
  7. fi
  8. rev=$(git rev-parse --short HEAD)
  9. mkdir deploy
  10. cd deploy
  11. git init
  12. git config user.name "Travis CI"
  13. git config user.email "build@travis.org"
  14. git remote add upstream "https://$GH_TOKEN@github.com/davemachado/public-apis.git"
  15. git fetch upstream
  16. git reset upstream/master
  17. mv ../json/*
  18. touch .
  19. git add -A .
  20. git commit -m "rebuild JSON at ${rev}"
  21. git push upstream HEAD:master