Class AnchoreBuilder
- java.lang.Object
-
- hudson.tasks.BuildStepCompatibilityLayer
-
- hudson.tasks.Builder
-
- com.anchore.jenkins.plugins.anchore.AnchoreBuilder
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<Builder>
,BuildStep
,SimpleBuildStep
public class AnchoreBuilder extends Builder implements SimpleBuildStep
Anchore Plugin enables Jenkins users to scan container images, generate analysis, evaluate gate policy, and execute customizable queries. The plugin can be used in a freestyle project as a step or invoked from a pipeline script
Requirements:
- Jenkins installed and configured either as a single system, or with multiple configured jenkins worker nodes
- Each host on which jenkins jobs will run must have docker installed and the jenkins user (or whichever user you have configured jenkins to run jobs as) must be allowed to interact with docker (either directly or via sudo)
- Each host on which jenkins jobs will run must have the latest anchore container image installed in the local docker host. To install, run 'docker pull anchore/jenkins:latest' on each jenkins host to make the image available to the plugin. The plugin will start an instance of the anchore/jenkins:latest docker container named 'jenkins_anchore' by default, on each host that runs a jenkins job that includes an Anchore Container Image Scanner step.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AnchoreBuilder.DescriptorImpl
-
Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
BuildStep.PublisherList
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Nested classes/interfaces inherited from interface jenkins.tasks.SimpleBuildStep
SimpleBuildStep.LastBuildAction, SimpleBuildStep.LastBuildActionFactory
-
-
Field Summary
-
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
-
-
Constructor Summary
Constructors Constructor Description AnchoreBuilder(String name)
-
Method Summary
-
Methods inherited from class hudson.tasks.Builder
all, getRequiredMonitorService, prebuild
-
Methods inherited from class hudson.tasks.BuildStepCompatibilityLayer
getProjectAction, getProjectAction, getProjectActions, perform, perform, prebuild
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface hudson.tasks.BuildStep
getProjectAction, getProjectActions, getRequiredMonitorService, perform, prebuild
-
Methods inherited from interface jenkins.tasks.SimpleBuildStep
perform, perform, requiresWorkspace
-
-
-
-
Constructor Detail
-
AnchoreBuilder
@DataBoundConstructor public AnchoreBuilder(String name)
-
-
Method Detail
-
getName
public String getName()
-
getEngineRetries
public String getEngineRetries()
-
getBailOnFail
public boolean getBailOnFail()
-
getBailOnPluginFail
public boolean getBailOnPluginFail()
-
getPolicyBundleId
public String getPolicyBundleId()
-
getAnnotations
public List<Annotation> getAnnotations()
-
getAutoSubscribeTagUpdates
public boolean getAutoSubscribeTagUpdates()
-
getForceAnalyze
public boolean getForceAnalyze()
-
getExcludeFromBaseImage
public boolean getExcludeFromBaseImage()
-
getEngineurl
public String getEngineurl()
-
getEngineCredentialsId
public String getEngineCredentialsId()
-
getEngineverify
public boolean getEngineverify()
-
setEngineRetries
@DataBoundSetter public void setEngineRetries(String engineRetries)
-
setBailOnFail
@DataBoundSetter public void setBailOnFail(boolean bailOnFail)
-
setBailOnPluginFail
@DataBoundSetter public void setBailOnPluginFail(boolean bailOnPluginFail)
-
setPolicyBundleId
@DataBoundSetter public void setPolicyBundleId(String policyBundleId)
-
setAnnotations
@DataBoundSetter public void setAnnotations(List<Annotation> annotations)
-
setAutoSubscribeTagUpdates
@DataBoundSetter public void setAutoSubscribeTagUpdates(boolean autoSubscribeTagUpdates)
-
setForceAnalyze
@DataBoundSetter public void setForceAnalyze(boolean forceAnalyze)
-
setExcludeFromBaseImage
@DataBoundSetter public void setExcludeFromBaseImage(boolean excludeFromBaseImage)
-
setEngineurl
@DataBoundSetter public void setEngineurl(String engineurl)
-
setEngineCredentialsId
@DataBoundSetter public void setEngineCredentialsId(String engineCredentialsId)
-
setEngineverify
@DataBoundSetter public void setEngineverify(boolean engineverify)
-
perform
public void perform(@Nonnull Run<?,?> run, @Nonnull FilePath workspace, @Nonnull Launcher launcher, @Nonnull TaskListener listener) throws InterruptedException, IOException
- Specified by:
perform
in interfaceSimpleBuildStep
- Throws:
InterruptedException
IOException
-
getDescriptor
public AnchoreBuilder.DescriptorImpl getDescriptor()
- Specified by:
getDescriptor
in interfaceDescribable<Builder>
- Overrides:
getDescriptor
in classBuilder
-
-