postCommitBuildTrigger.sh 453 B

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. # the base url of the bamboo server
  3. baseurl="$1/updateAndBuild.action?buildKey="
  4. #
  5. # Use the REST API to trigger a build
  6. #
  7. # Moves to the 2nd param (first is URL)
  8. shift
  9. # Loop for each build key
  10. while (( "$#" )); do
  11. #
  12. # Invoke the trigger
  13. #
  14. remoteCall=$baseurl$1
  15. echo "Detected last directory that was committed ... triggering $remoteCall"
  16. /usr/bin/wget --timeout=10 -t1 $remoteCall -O /dev/null
  17. shift
  18. done
  19. exit 0