Skip to content

Commit

Permalink
Plugin upgrades and bug fixes...
Browse files Browse the repository at this point in the history
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
Show file tree
Hide file tree
Showing 28 changed files with 1,183 additions and 857 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Expand Up @@ -13,3 +13,10 @@ hs_err_pid*

# build stuff
target/

# IDE
.idea
*.iml

# OS
.DS_Store
@@ -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);
}
}

0 comments on commit 5a7e570

Please sign in to comment.