diff options
author | rgroux <richard.groux+github@gmail.com> | 2015-12-16 13:37:45 +0100 |
---|---|---|
committer | rgroux <richard.groux+github@gmail.com> | 2015-12-16 13:37:45 +0100 |
commit | 306116c30db7714ec9011ae2d43addcc6bcdc081 (patch) | |
tree | a49f7533b4f701b74626f1d38e91504e821966f7 /src | |
parent | 7b7b0d54b606e5a7d63ea39ec8918968f612d61d (diff) | |
download | gitblit-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')
-rw-r--r-- | src/main/distrib/data/groovy/jenkins.groovy | 5 |
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()
|