Skip to content

Commit

Permalink
[JENKINS-33276] Expands env parameters on repo URL
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio Mansilla committed Apr 19, 2016
1 parent 4848e0b commit 32e1ecb
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -26,6 +26,7 @@
import hudson.tasks.Publisher;
import hudson.util.FormValidation;
import hudson.util.ListBoxModel;
import hudson.util.LogTaskListener;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
Expand Down Expand Up @@ -183,8 +184,10 @@ private BitbucketBuildStatusResource createBuildStatusResourceFromBuild(final Ab
throw new Exception("Bitbucket build notifier support only repositories hosted in bitbucket.org");
}

// expand parameters on repo url
String repoUrl = build.getEnvironment(new LogTaskListener(logger, Level.INFO)).expand(urIish.getPath());

// extract bitbucket user name and repository name from repo URI
String repoUrl = urIish.getPath();
String repoName = repoUrl.substring(
repoUrl.lastIndexOf("/") + 1,
repoUrl.indexOf(".git") > -1 ? repoUrl.indexOf(".git") : repoUrl.length()
Expand Down

0 comments on commit 32e1ecb

Please sign in to comment.