aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorS.Nishio <nishio@densan-labs.net>2016-04-30 00:06:00 +0900
committerS.Nishio <nishio@densan-labs.net>2016-04-30 00:06:00 +0900
commit8af88eec6b4e8deb09aa9efd47769749cdc0afbc (patch)
tree4fa0faafb1eae98735859baaeb1f1fc64c8117e6 /src
parent7e3716b7fcc5dc23f44d334f99c85fe7e8cbf056 (diff)
parente498785d940fb3fdffc350b6b09607d5e8051b21 (diff)
downloadbbprb-8af88eec6b4e8deb09aa9efd47769749cdc0afbc.tar.gz
Merge pull request #85 from michaeljb/fix-root-url
Use JenkinsLocationConfiguration to fetch the URL.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketBuilds.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketBuilds.java b/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketBuilds.java
index 3e8e84b..ea8e892 100644
--- a/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketBuilds.java
+++ b/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketBuilds.java
@@ -5,6 +5,7 @@ import hudson.model.AbstractBuild;
import hudson.model.Cause;
import hudson.model.Result;
import jenkins.model.Jenkins;
+import jenkins.model.JenkinsLocationConfiguration;
import java.io.IOException;
import java.util.logging.Level;
@@ -49,7 +50,8 @@ public class BitbucketBuilds {
return;
}
Result result = build.getResult();
- String rootUrl = Jenkins.getInstance().getRootUrl();
+ JenkinsLocationConfiguration globalConfig = new JenkinsLocationConfiguration();
+ String rootUrl = globalConfig.getUrl();
String buildUrl = "";
if (rootUrl == null) {
logger.warning("PLEASE SET JENKINS ROOT URL IN GLOBAL CONFIGURATION FOR BUILD STATE REPORTING");