diff options
author | S.Nishio <nishio@densan-labs.net> | 2016-04-30 00:06:00 +0900 |
---|---|---|
committer | S.Nishio <nishio@densan-labs.net> | 2016-04-30 00:06:00 +0900 |
commit | 8af88eec6b4e8deb09aa9efd47769749cdc0afbc (patch) | |
tree | 4fa0faafb1eae98735859baaeb1f1fc64c8117e6 | |
parent | 7e3716b7fcc5dc23f44d334f99c85fe7e8cbf056 (diff) | |
parent | e498785d940fb3fdffc350b6b09607d5e8051b21 (diff) | |
download | bbprb-8af88eec6b4e8deb09aa9efd47769749cdc0afbc.tar.gz |
Merge pull request #85 from michaeljb/fix-root-url
Use JenkinsLocationConfiguration to fetch the URL.
-rw-r--r-- | src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketBuilds.java | 4 |
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"); |