public class Oak9Builder extends Builder implements SimpleBuildStep
| Modifier and Type | Class and Description |
|---|---|
static class |
Oak9Builder.DescriptorImpl |
SimpleBuildStep.LastBuildAction, SimpleBuildStep.LastBuildActionFactoryBuildStep.PublisherListExtensionPoint.LegacyInstancesAreScopedToHudsonBUILDERS, PUBLISHERS| Constructor and Description |
|---|
Oak9Builder(String orgId,
String projectId,
String credentialsId,
int maxSeverity,
String baseUrl)
Constructor is setup by Jenkins when it instantiates the plugin
|
| Modifier and Type | Method and Description |
|---|---|
Oak9ApiClient |
generateHttpClient(Run<?,?> run,
TaskListener taskListener)
Generate an API client to inject
|
String |
getBaseUrl()
Returns the current base URL
|
String |
getCredentialsId()
Fetches the credentials ID selected for the job
|
int |
getMaxSeverity()
The severity at or above which the job will fail
|
String |
getOrgId()
Fetches the user-specified oak9 Organization ID
|
String |
getProjectId()
Fetches the Jenkins Project ID
|
void |
perform(Run<?,?> run,
FilePath workspace,
EnvVars env,
Launcher launcher,
TaskListener taskListener)
Jenkins plugin entry point.
|
void |
setBaseUrl(String baseUrl)
Sets the BaseURL for communication with the oak9 API
|
void |
setCredentialsId(String credentialsId)
Sets the credentials ID to be used for the runner
|
void |
setMaxSeverity(int maxSeverity)
Sets the severity at which the job will fail
|
void |
setOrgId(String orgId)
Sets the oak9 Organization ID for the runner
|
void |
setProjectId(String projectId)
Sets the oak9 project ID for the runner
|
all, getDescriptor, getRequiredMonitorService, prebuildgetProjectAction, getProjectAction, getProjectActions, perform, perform, prebuildclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitperform, perform, requiresWorkspacegetProjectAction, getProjectActions, getRequiredMonitorService, perform, prebuild@DataBoundConstructor public Oak9Builder(String orgId, String projectId, String credentialsId, int maxSeverity, String baseUrl)
orgId - the oak9-provided org IDprojectId - the oak9-provided project IDcredentialsId - the ID to use to fetch the oak9 API Key from Jenkins secretsmaxSeverity - the severity at which the job will fail (at or above)@DataBoundSetter public void setOrgId(String orgId)
orgId - the oak9-provided org ID@DataBoundSetter public void setProjectId(String projectId)
projectId - the oak9-provided project ID@DataBoundSetter public void setCredentialsId(String credentialsId)
credentialsId - a string for the credentials ID@DataBoundSetter public void setMaxSeverity(int maxSeverity)
maxSeverity - an integer representing the max severity refer to io.jenkins.plugins.oak9.utils.Severity@DataBoundSetter public void setBaseUrl(String baseUrl)
baseUrl - the base URL to usepublic String getBaseUrl()
public String getOrgId()
public String getProjectId()
public String getCredentialsId()
public int getMaxSeverity()
public Oak9ApiClient generateHttpClient(Run<?,?> run, TaskListener taskListener)
run - the Jenkins runtaskListener - the Jenkins task listener for loggingpublic void perform(@NonNull
Run<?,?> run,
@NonNull
FilePath workspace,
@NonNull
EnvVars env,
@NonNull
Launcher launcher,
@NonNull
TaskListener taskListener)
throws IOException,
InterruptedException
perform in interface SimpleBuildSteprun - the current Jenkins buildworkspace - FilePath representing the Jenkins workspace for this projectenv - Environment variableslauncher - the Jenkins launchertaskListener - the Jenkins task listener, used primarily for logging and setting task statusIOException - Thrown in the event of a permanent errorInterruptedExceptionCopyright © 2016–2021. All rights reserved.