travis_update_generated_repos.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/bin/bash
  2. # Do only build for Python 2.7
  3. # as we only want to deploy for one
  4. # unique generator.
  5. PYTHONVER=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:3])))')
  6. if [[ $PYTHONVER != "2.7"* ]]
  7. then
  8. echo -e "Skipping header generation for Python $PYTHONVER"
  9. exit 0
  10. fi
  11. # Do not build pull requests
  12. if [[ $TRAVIS_PULL_REQUEST != "false" ]]
  13. then
  14. exit 0
  15. fi
  16. # Do only build master branch
  17. if [[ $TRAVIS_BRANCH != "master" ]]
  18. then
  19. exit 0
  20. fi
  21. # Config for auto-building
  22. git remote rename origin upstream
  23. git config --global user.email "bot@pixhawk.org"
  24. git config --global user.name "PX4BuildBot"
  25. git config --global credential.helper "store --file=$HOME/.git-credentials"
  26. echo "https://${GH_TOKEN}:@github.com" > "$HOME"/.git-credentials
  27. # Build C library
  28. GEN_START_PATH=$PWD
  29. mkdir -p include/mavlink/v2.0
  30. cd include/mavlink/v2.0
  31. git clone https://github.com/mavlink/c_library_v2.git
  32. cd ../../..
  33. ./scripts/update_c_library.sh 2
  34. # v1.0 legacy
  35. cd "$GEN_START_PATH"
  36. mkdir -p include/mavlink/v1.0
  37. cd include/mavlink/v1.0
  38. git clone https://github.com/mavlink/c_library_v1.git
  39. cd ../../..
  40. ./scripts/update_c_library.sh 1
  41. # XXX add build steps for other libraries as well