Adding commit hook scripts for running phpunit
This commit is contained in:
parent
6d63b81f76
commit
c161b664d5
2 changed files with 38 additions and 0 deletions
13
commit-hook-scripts/postCommitBuildTrigger.py
Normal file
13
commit-hook-scripts/postCommitBuildTrigger.py
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
#!/usr/bin/python
|
||||||
|
#
|
||||||
|
# ./postCommitBuildTrigger.py http://bamoo.atlassian.com/bamboo/ myBuildName
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import urllib;
|
||||||
|
|
||||||
|
baseUrl = sys.argv[1]
|
||||||
|
buildKey = sys.argv[2]
|
||||||
|
|
||||||
|
remoteCall = baseUrl + "/api/rest/updateAndBuild.action?buildKey=" + buildKey
|
||||||
|
fileHandle = urllib.urlopen(remoteCall)
|
||||||
|
fileHandle.close()
|
25
commit-hook-scripts/postCommitBuildTrigger.sh
Executable file
25
commit-hook-scripts/postCommitBuildTrigger.sh
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# the base url of the bamboo server
|
||||||
|
baseurl="$1/updateAndBuild.action?buildKey="
|
||||||
|
|
||||||
|
#
|
||||||
|
# Use the REST API to trigger a build
|
||||||
|
#
|
||||||
|
|
||||||
|
# Moves to the 2nd param (first is URL)
|
||||||
|
shift
|
||||||
|
# Loop for each build key
|
||||||
|
while (( "$#" )); do
|
||||||
|
|
||||||
|
#
|
||||||
|
# Invoke the trigger
|
||||||
|
#
|
||||||
|
remoteCall=$baseurl$1
|
||||||
|
echo "Detected last directory that was committed ... triggering $remoteCall"
|
||||||
|
/usr/bin/wget --timeout=10 -t1 $remoteCall -O /dev/null
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
exit 0
|
Loading…
Add table
Add a link
Reference in a new issue