check-remote 566 B

1234567891011121314151617181920212223
  1. #!/bin/sh -e
  2. if [ $# -lt 3 ]
  3. then
  4. echo "Usage: $0 GIT-USER GIT-BRANCH USER-MNT"
  5. exit
  6. fi
  7. clean_up() {
  8. git merge --abort > /dev/null
  9. }
  10. (git merge HEAD || clean_up) > /dev/null
  11. git pull --ff-only > /dev/null
  12. if ! git config "remote.$1.url" > /dev/null; then
  13. git remote add "$1" "git@git.dn42:$1/registry.git"
  14. fi
  15. git fetch "$1" 2> /dev/null
  16. git merge --no-ff --no-commit "$1/$2" 2> /dev/null
  17. ./check-pol HEAD "$3" || (echo "Policy Check FAILED"; clean_up; exit 1)
  18. ./check-my-stuff "$3" || (echo "Schema Check FAILED"; clean_up; exit 1)
  19. echo OK
  20. clean_up