Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ public static void triggerJob(CommitItem commitItem) {
CollectorApi.getCommitItemContainer().save(commitItem);
ImmutableMap.Builder<String, String> finalJenkinsParams = ImmutableMap.<String, String>builder().put("token",VerigreenNeededLogic.properties.getProperty("jenkins.password"));
finalJenkinsParams.put(CollectorApi.getBranchParamName(), branchName);
for(String key : commitParams.keySet())
for(Map.Entry<String, String> entry : commitParams.entrySet())
{
finalJenkinsParams.put(key,commitParams.get(key));
finalJenkinsParams.put(entry.getKey(),entry.getValue());
}
final ImmutableMap<String, String> params = finalJenkinsParams.build();
job2Verify.build(params);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,8 @@ public static Map<String, String> checkJenkinsMode(CommitItem commitItem) {

if(jenkinsParams.get("jenkinsparam.mode") != null && jenkinsParams.get("jenkinsparam.mode").equals("json")){
JsonObject json = new JsonObject();
for(String key : paramMap.keySet()){
json.addProperty(key, paramMap.get(key));
for(Map.Entry<String, String> entry: paramMap.entrySet()){
json.addProperty(entry.getKey(), entry.getValue());
}
resultMap.put("json",json.toString());
}
Expand All @@ -346,47 +346,48 @@ public static Map<String, String> checkJenkinsMode(CommitItem commitItem) {
public static Map<String, String> commitItemAsParameterMap(CommitItem commitItem) {

Map<String, String> returnedForJenkins = new HashMap<String,String>();
for(String key : jenkinsParams.keySet())
for(Map.Entry<String, String> entry : jenkinsParams.entrySet())
{
String key = entry.getKey();
if(key.contains("commitid")){
if (jenkinsParams.get(key).equals("true")){
if (entry.getValue().equals("true")){
returnedForJenkins.put("commitid",commitItem.getBranchDescriptor().getNewBranch());
}
else if (!jenkinsParams.get(key).equals("false")){
returnedForJenkins.put(jenkinsParams.get(key), commitItem.getBranchDescriptor().getNewBranch());
else if (!entry.getValue().equals("false")){
returnedForJenkins.put(entry.getValue(), commitItem.getBranchDescriptor().getNewBranch());
}
}
else if(key.contains("committer")){
if (jenkinsParams.get(key).equals("true")){
if (entry.getValue().equals("true")){
returnedForJenkins.put("committer",commitItem.getBranchDescriptor().getCommitter());
}
else if (!jenkinsParams.get(key).equals("false")){
returnedForJenkins.put(jenkinsParams.get(key), commitItem.getBranchDescriptor().getCommitter());
else if (!entry.getValue().equals("false")){
returnedForJenkins.put(entry.getValue(), commitItem.getBranchDescriptor().getCommitter());
}
}
else if(key.contains("longid")){
if (jenkinsParams.get(key).equals("true")){
if (entry.getValue().equals("true")){
returnedForJenkins.put("longid",commitItem.getBranchDescriptor().getCommitId());
}
else if (!jenkinsParams.get(key).equals("false")){
returnedForJenkins.put(jenkinsParams.get(key),commitItem.getBranchDescriptor().getCommitId());
else if (!entry.getValue().equals("false")){
returnedForJenkins.put(entry.getValue(),commitItem.getBranchDescriptor().getCommitId());
}
}
else if(key.contains("jenkinsparam.protected")){
if(jenkinsParams.get(key).equals("true")){
if(entry.getValue().equals("true")){
returnedForJenkins.put("protected",commitItem.getBranchDescriptor().getProtectedBranch());
}
else if (!jenkinsParams.get(key).equals("false")){
returnedForJenkins.put(jenkinsParams.get(key), commitItem.getBranchDescriptor().getProtectedBranch());
else if (!entry.getValue().equals("false")){
returnedForJenkins.put(entry.getValue(), commitItem.getBranchDescriptor().getProtectedBranch());
}
}
else if(key.contains("parent")){
String paraent = commitItem.getParent() == null?commitItem.getBranchDescriptor().getProtectedBranch():commitItem.getParent().getBranchDescriptor().getNewBranch();
if(jenkinsParams.get(key).equals("true")){
if(entry.getValue().equals("true")){
returnedForJenkins.put("parent",paraent);
}
else if (!jenkinsParams.get(key).equals("false")){
returnedForJenkins.put(jenkinsParams.get(key), paraent);
else if (!entry.getValue().equals("false")){
returnedForJenkins.put(entry.getValue(), paraent);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ else if(!branchesMap.get(branch.subSequence(0, 10)).contains(branch)){
branchesMap.remove(branch.getBranchDescriptor().getNewBranch().subSequence(0, 10));
}
}
for(String key : branchesMap.keySet()) {
result.addAll(branchesMap.get(key));
for(Map.Entry<String, List <String>> entry : branchesMap.entrySet()) {
result.addAll(entry.getValue());
}

try {
Expand Down