summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorrgroux <richard.groux+github@gmail.com>2015-12-16 13:37:45 +0100
committerrgroux <richard.groux+github@gmail.com>2015-12-16 13:37:45 +0100
commit306116c30db7714ec9011ae2d43addcc6bcdc081 (patch)
treea49f7533b4f701b74626f1d38e91504e821966f7 /src/main
parent7b7b0d54b606e5a7d63ea39ec8918968f612d61d (diff)
downloadgitblit-306116c30db7714ec9011ae2d43addcc6bcdc081.tar.gz
gitblit-306116c30db7714ec9011ae2d43addcc6bcdc081.zip
Change Jenkins groovy script for any protocol (git/http/ssh)
groovy.jenkinsGitbaseurl in gitblit.properties or web.xml can override the http default protocol
Diffstat (limited to 'src/main')
-rw-r--r--src/main/distrib/data/groovy/jenkins.groovy5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/distrib/data/groovy/jenkins.groovy b/src/main/distrib/data/groovy/jenkins.groovy
index 422b2200..f029b26a 100644
--- a/src/main/distrib/data/groovy/jenkins.groovy
+++ b/src/main/distrib/data/groovy/jenkins.groovy
@@ -69,8 +69,11 @@ logger.info("jenkins hook triggered by ${user.username} for ${repository.name}")
// gitblit.properties or web.xml
def jenkinsUrl = gitblit.getString('groovy.jenkinsServer', 'http://yourserver/jenkins')
+// define the repository base url
+def jenkinsGitbaseurl = gitblit.getString('groovy.jenkinsGitbaseurl', "${url}/r")
+
// define the trigger url
-def triggerUrl = jenkinsUrl + "/git/notifyCommit?url=${url}/r/${repository.name}"
+def triggerUrl = jenkinsUrl + "/git/notifyCommit?url=" + jenkinsGitbaseurl + "/${repository.name}"
// trigger the build
new URL(triggerUrl).getContent()