diff --git a/src/main/java/com/anchore/jenkins/plugins/anchore/AnchoreBuilder.java b/src/main/java/com/anchore/jenkins/plugins/anchore/AnchoreBuilder.java index 1c9c05d..f5226d1 100644 --- a/src/main/java/com/anchore/jenkins/plugins/anchore/AnchoreBuilder.java +++ b/src/main/java/com/anchore/jenkins/plugins/anchore/AnchoreBuilder.java @@ -75,8 +75,8 @@ public class AnchoreBuilder extends Builder implements SimpleBuildStep { private List inputQueries; private String policyBundleId = DescriptorImpl.DEFAULT_POLICY_BUNDLE_ID; private List annotations; - private boolean autoSubscribeTag = DescriptorImpl.DEFAULT_TAG_AUTOSUBSCRIBE; - private boolean force = DescriptorImpl.DEFAULT_USE_FORCE_FLAG; + private boolean autoSubscribeTagUpdates = DescriptorImpl.DEFAULT_AUTOSUBSCRIBE_TAG_UPDATES; + private boolean forceAnalyze = DescriptorImpl.DEFAULT_FORCE_ANALYZE; // Override global config. Supported for anchore-engine mode config only private String engineurl = DescriptorImpl.EMPTY_STRING; @@ -154,12 +154,12 @@ public List getAnnotations() { return annotations; } - public boolean getAutoSubscribeTag() { - return autoSubscribeTag; + public boolean getAutoSubscribeTagUpdates() { + return autoSubscribeTagUpdates; } - public boolean getForce() { - return force; + public boolean getForceAnalyze() { + return forceAnalyze; } public String getEngineurl() { @@ -256,13 +256,13 @@ public void setAnnotations(List annotations) { } @DataBoundSetter - public void setAutoSubscribeTag(boolean autoSubscribeTag) { - this.autoSubscribeTag = autoSubscribeTag; + public void setAutoSubscribeTagUpdates(boolean autoSubscribeTagUpdates) { + this.autoSubscribeTagUpdates = autoSubscribeTagUpdates; } @DataBoundSetter - public void setForce(boolean force) { - this.force = force; + public void setForceAnalyze(boolean forceAnalyze) { + this.forceAnalyze = forceAnalyze; } @DataBoundSetter @@ -331,7 +331,7 @@ public void perform(@Nonnull Run run, @Nonnull FilePath workspace, @Nonnul /* Instantiate config and a new build worker */ config = new BuildConfig(name, policyName, globalWhiteList, anchoreioUser, anchoreioPass, userScripts, engineRetries, bailOnFail, bailOnWarn, bailOnPluginFail, doCleanup, useCachedBundle, policyEvalMethod, bundleFileOverride, inputQueries, policyBundleId, - annotations, autoSubscribeTag, force, globalConfig.getDebug(), globalConfig.getEnginemode(), + annotations, autoSubscribeTagUpdates, forceAnalyze, globalConfig.getDebug(), globalConfig.getEnginemode(), // messy build time overrides, ugh! !Strings.isNullOrEmpty(engineurl) ? engineurl : globalConfig.getEngineurl(), !Strings.isNullOrEmpty(engineuser) ? engineuser : globalConfig.getEngineuser(), @@ -439,8 +439,8 @@ public static final class DescriptorImpl extends BuildStepDescriptor { new AnchoreQuery("show-pkg-diffs base")); public static final String DEFAULT_POLICY_BUNDLE_ID = ""; public static final String EMPTY_STRING = ""; - public static final boolean DEFAULT_TAG_AUTOSUBSCRIBE = true; - public static final boolean DEFAULT_USE_FORCE_FLAG = false; + public static final boolean DEFAULT_AUTOSUBSCRIBE_TAG_UPDATES = true; + public static final boolean DEFAULT_FORCE_ANALYZE = false; // Global configuration private boolean debug; diff --git a/src/main/java/com/anchore/jenkins/plugins/anchore/BuildConfig.java b/src/main/java/com/anchore/jenkins/plugins/anchore/BuildConfig.java index 0e476a4..f10d04c 100644 --- a/src/main/java/com/anchore/jenkins/plugins/anchore/BuildConfig.java +++ b/src/main/java/com/anchore/jenkins/plugins/anchore/BuildConfig.java @@ -28,8 +28,8 @@ public class BuildConfig { private List inputQueries; private String policyBundleId; private List annotations; - private boolean autoSubscribeTag; - private boolean force; + private boolean autoSubscribeTagUpdates; + private boolean forceAnalyze; // Global configuration private boolean debug; @@ -47,7 +47,7 @@ public class BuildConfig { public BuildConfig(String name, String policyName, String globalWhiteList, String anchoreioUser, String anchoreioPass, String userScripts, String engineRetries, boolean bailOnFail, boolean bailOnWarn, boolean bailOnPluginFail, boolean doCleanup, boolean useCachedBundle, String policyEvalMethod, String bundleFileOverride, List inputQueries, - String policyBundleId, List annotations, boolean autoSubscribeTag, boolean force, boolean debug, String enginemode, + String policyBundleId, List annotations, boolean autoSubscribeTagUpdates, boolean forceAnalyze, boolean debug, String enginemode, String engineurl, String engineuser, String enginepass, boolean engineverify, String containerImageId, String containerId, String localVol, String modulesVol, boolean useSudo) { this.name = name; @@ -67,8 +67,8 @@ public BuildConfig(String name, String policyName, String globalWhiteList, Strin this.inputQueries = inputQueries; this.policyBundleId = policyBundleId; this.annotations = annotations; - this.autoSubscribeTag = autoSubscribeTag; - this.force = force; + this.autoSubscribeTagUpdates = autoSubscribeTagUpdates; + this.forceAnalyze = forceAnalyze; this.debug = debug; this.enginemode = enginemode; this.engineurl = engineurl; @@ -154,12 +154,12 @@ public List getAnnotations() { return annotations; } - public boolean getAutoSubscribeTag() { - return autoSubscribeTag; + public boolean getAutoSubscribeTagUpdates() { + return autoSubscribeTagUpdates; } - - public boolean getForce() { - return force; + + public boolean getForceAnalyze() { + return forceAnalyze; } public boolean getDebug() { diff --git a/src/main/java/com/anchore/jenkins/plugins/anchore/BuildWorker.java b/src/main/java/com/anchore/jenkins/plugins/anchore/BuildWorker.java index eb49b4f..d6ebf6a 100644 --- a/src/main/java/com/anchore/jenkins/plugins/anchore/BuildWorker.java +++ b/src/main/java/com/anchore/jenkins/plugins/anchore/BuildWorker.java @@ -231,12 +231,12 @@ private void runAnalyzerEngine() throws AbortException { String theurl = config.getEngineurl().replaceAll("/+$", "") + "/images"; // Disable autosubscribe if necessary - if (!config.getAutoSubscribeTag()){ + if (!config.getAutoSubscribeTagUpdates()){ queryList.add("autosubscribe=false"); } // Enable force if necessary - if (config.getForce()) { + if (config.getForceAnalyze()) { queryList.add("force=true"); } diff --git a/src/main/resources/com/anchore/jenkins/plugins/anchore/AnchoreBuilder/config.jelly b/src/main/resources/com/anchore/jenkins/plugins/anchore/AnchoreBuilder/config.jelly index 081b8f4..7ccb193 100644 --- a/src/main/resources/com/anchore/jenkins/plugins/anchore/AnchoreBuilder/config.jelly +++ b/src/main/resources/com/anchore/jenkins/plugins/anchore/AnchoreBuilder/config.jelly @@ -35,12 +35,12 @@ - - + + - - + + diff --git a/src/main/resources/com/anchore/jenkins/plugins/anchore/AnchoreBuilder/help-autoSubscribeTag.html b/src/main/resources/com/anchore/jenkins/plugins/anchore/AnchoreBuilder/help-autoSubscribeTagUpdates.html similarity index 100% rename from src/main/resources/com/anchore/jenkins/plugins/anchore/AnchoreBuilder/help-autoSubscribeTag.html rename to src/main/resources/com/anchore/jenkins/plugins/anchore/AnchoreBuilder/help-autoSubscribeTagUpdates.html diff --git a/src/main/resources/com/anchore/jenkins/plugins/anchore/AnchoreBuilder/help-force.html b/src/main/resources/com/anchore/jenkins/plugins/anchore/AnchoreBuilder/help-force.html deleted file mode 100644 index 76ba851..0000000 --- a/src/main/resources/com/anchore/jenkins/plugins/anchore/AnchoreBuilder/help-force.html +++ /dev/null @@ -1,6 +0,0 @@ -
- - If selected or set to 'true', the Anchore Container Image Scanner step will send API requests to Anchore Engine with force flag enabled - (force=true query parameter). Default value: 'false' - -
diff --git a/src/main/resources/com/anchore/jenkins/plugins/anchore/AnchoreBuilder/help-forceAnalyze.html b/src/main/resources/com/anchore/jenkins/plugins/anchore/AnchoreBuilder/help-forceAnalyze.html new file mode 100644 index 0000000..c1a9142 --- /dev/null +++ b/src/main/resources/com/anchore/jenkins/plugins/anchore/AnchoreBuilder/help-forceAnalyze.html @@ -0,0 +1,6 @@ +
+ + If selected or set to 'true', the Anchore Container Image Scanner step will instruct Anchore Engine to force analyze the image. + Default value: 'false' + +