-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #195 from aheuermann/target_branch
Adding target and source branch env variables for pull requests
- Loading branch information
Showing
6 changed files
with
56 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,14 +25,9 @@ of this software and associated documentation files (the "Software"), to deal | |
|
||
import com.groupon.jenkins.git.GitBranch; | ||
import com.groupon.jenkins.github.Payload; | ||
import com.jcraft.jsch.jce.MD5; | ||
import hudson.model.Cause; | ||
|
||
import java.io.UnsupportedEncodingException; | ||
import java.math.BigInteger; | ||
import java.nio.charset.StandardCharsets; | ||
import java.security.MessageDigest; | ||
import java.security.NoSuchAlgorithmException; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
|
@@ -56,6 +51,7 @@ public abstract class BuildCause extends Cause { | |
public abstract String getPullRequestNumber(); | ||
|
||
public abstract CommitInfo getCommitInfo(); | ||
|
||
@Exported | ||
public abstract String getName(); | ||
|
||
|
@@ -67,7 +63,7 @@ public Map<String, String> getEnvVars() { | |
return vars; | ||
} | ||
|
||
private static void putIfNotNull(Map<String, String> vars, String key, String value) { | ||
protected static void putIfNotNull(Map<String, String> vars, String key, String value) { | ||
if (value != null) { | ||
vars.put(key, value); | ||
} | ||
|
@@ -88,6 +84,7 @@ public static class CommitInfo{ | |
private String branch; | ||
private final String sha; | ||
private String commitUrl; | ||
|
||
//for backward compat | ||
private CommitInfo(){ | ||
this.committerEmail = "[email protected]"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters