travis_push_coverity.sh 864 B

12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. # This script is run by travis-ci and pushes the first commit
  3. # of the day to the coverity scan service
  4. git fetch origin coverity_scan
  5. COMMITS=`git log --oneline --since=today.midnight | wc -l`
  6. if [ "$COMMITS" -le 1 ]; then
  7. #first commit a day - push changes to branch coverity_scan
  8. git clone -b coverity_scan https://$GITAUTH@github.com/acplt/open62541
  9. cd open62541
  10. git fetch origin
  11. git merge origin/master
  12. git config --global user.email "open62541-travis-ci@users.noreply.github.com"
  13. git config --global user.name "Open62541 travis-ci"
  14. git config --global push.default simple
  15. git add *
  16. git commit -am "push to coverity scan by travis-ci"
  17. git push https://$GITAUTH@github.com/acplt/open62541
  18. cd ..
  19. rm -rf open62541
  20. else
  21. echo "Not the first commit of the day - no push to coverity required"
  22. fi