Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Display Jenkins and Anchore plugin versions in build console log. Use default Anchore policy if it's not provided to plugin - JENKINS-41081. Dynamic list of queries. Improve logging. Clean up workspaces after plugin execution regardless of the end result.
- Loading branch information
Swathi Gangisetty
committed
Jan 27, 2017
1 parent
614a9d1
commit 5a7e570
Showing
28 changed files
with
1,183 additions
and
857 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,10 @@ hs_err_pid* | |
|
||
# build stuff | ||
target/ | ||
|
||
# IDE | ||
.idea | ||
*.iml | ||
|
||
# OS | ||
.DS_Store |
99 changes: 49 additions & 50 deletions
99
src/main/java/com/anchore/jenkins/plugins/anchore/AnchoreAction.java
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 |
---|---|---|
@@ -1,59 +1,58 @@ | ||
package com.anchore.jenkins.plugins.anchore; | ||
import hudson.model.Action; | ||
|
||
import hudson.model.AbstractBuild; | ||
import hudson.model.Action; | ||
import java.util.Map; | ||
import java.util.TreeMap; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class AnchoreAction implements Action { | ||
|
||
private String gateStatus; | ||
private String gateReportUrl; | ||
private String queryReportUrl; | ||
private TreeMap<String, String> queries; | ||
private AbstractBuild<?,?> build; | ||
|
||
public AnchoreAction(AbstractBuild<?,?> build, String gateStatus, String euid, TreeMap<String, String> queries) { | ||
this.gateReportUrl = "../artifact/AnchoreReport."+euid+"/anchore_gates_format.html"; | ||
this.queryReportUrl = "../artifact/AnchoreReport."+euid+"/anchore_query_format.html"; | ||
this.build = build; | ||
this.gateStatus = gateStatus; | ||
this.queries = new TreeMap<String, String>(); | ||
for (Map.Entry<String, String> entry : queries.entrySet()) { | ||
this.queries.put("../artifact/AnchoreReport."+euid+"/" + entry.getKey() + "_format.html", entry.getValue()); | ||
} | ||
} | ||
|
||
@Override | ||
public String getIconFileName() { | ||
return "/plugin/anchore-container-scanner/images/anchore.png"; | ||
} | ||
|
||
@Override | ||
public String getDisplayName() { | ||
return "Anchore Report (" + gateStatus + ")"; | ||
} | ||
|
||
@Override | ||
public String getUrlName() { | ||
return "anchore-results"; | ||
} | ||
|
||
public AbstractBuild<?,?> getBuild() { | ||
return this.build; | ||
} | ||
|
||
public String getGateReportUrl() { | ||
return this.gateReportUrl; | ||
} | ||
|
||
public String getQueryReportUrl() { | ||
return this.queryReportUrl; | ||
} | ||
|
||
public Map<String, String> getQueries() { | ||
return(this.queries); | ||
} | ||
private String gateStatus; | ||
private String gateReportUrl; | ||
private String queryReportUrl; | ||
private Map<String, String> queries; | ||
private AbstractBuild<?, ?> build; | ||
|
||
public AnchoreAction(AbstractBuild<?, ?> build, String gateStatus, String euid, Map<String, String> queries) { | ||
this.gateReportUrl = "../artifact/AnchoreReport." + euid + "/anchore_gates_format.html"; | ||
this.queryReportUrl = "../artifact/AnchoreReport." + euid + "/anchore_query_format.html"; | ||
this.build = build; | ||
this.gateStatus = gateStatus; | ||
this.queries = new TreeMap<String, String>(); | ||
for (Map.Entry<String, String> entry : queries.entrySet()) { | ||
this.queries.put("../artifact/AnchoreReport." + euid + "/" + entry.getKey() + "_format.html", entry.getValue()); | ||
} | ||
} | ||
|
||
@Override | ||
public String getIconFileName() { | ||
return "/plugin/anchore-container-scanner/images/anchore.png"; | ||
} | ||
|
||
@Override | ||
public String getDisplayName() { | ||
return "Anchore Report (" + gateStatus + ")"; | ||
} | ||
|
||
@Override | ||
public String getUrlName() { | ||
return "anchore-results"; | ||
} | ||
|
||
public AbstractBuild<?, ?> getBuild() { | ||
return this.build; | ||
} | ||
|
||
public String getGateReportUrl() { | ||
return this.gateReportUrl; | ||
} | ||
|
||
public String getQueryReportUrl() { | ||
return this.queryReportUrl; | ||
} | ||
|
||
public Map<String, String> getQueries() { | ||
return (this.queries); | ||
} | ||
} | ||
|
Oops, something went wrong.