Class BaseJob
- java.lang.Object
-
- com.vectorcast.plugins.vectorcastexecution.job.BaseJob
-
- Direct Known Subclasses:
NewPipelineJob,NewSingleJob
public abstract class BaseJob extends Object
Base job management - create/delete/update.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBaseJob(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse resp)Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddArchiveArtifacts(Project<?,?> project)Add archive artifacts step.protected voidaddCopyResultsToImport(Project<?,?> project)Add archive artifacts step.protected voidaddCredentialID(Project<?,?> project)Add credentials for coverage reporting step.protected voidaddDelWSBeforeBuild(Project<?,?> project)Add the delete workspace before build starts option.protected voidaddJenkinsCoverage(Project<?,?> project)Add Jenkins coverage reporting step.protected voidaddJunit(Project<?,?> project)Add JUnit rules step.protected voidaddPCLintPlus(Project<?,?> project)Add PC-Lint Plus step.protected voidaddReferenceBuild(Project<?,?> project)Add Jenkins coverage reporting step.protected VectorCASTSetupaddSetup(Project<?,?> project)Add the VectorCAST setup step to copy the python scripts to.protected voidaddVCCoverage(Project<?,?> project)Add VectorCAST coverage reporting step.protected abstract voidcleanupProject()Cleanup top-level project, as in delete.voidcreate()Create the job(s).protected abstract Project<?,?>createProject()Create top-level project.protected abstract voiddoCreate()Do create of project details.protected URLgetBaselineLinuxSingleFile()Call to get baseline linux single job file.protected URLgetBaselinePipelineGroovy()Call to get baseline groovy script for pipeline job.protected URLgetBaselinePostBuildGroovyScript()Call to get baseline post-build groovy job file.protected URLgetBaselineWindowsSingleFile()Call to get baseline windows single job file.protected StringgetBaseName()Get base name of manage project.protected StringgetEnvironmentSetupUnix()Get environment setup for unix.protected StringgetEnvironmentSetupWin()Get environment setup for windows.protected StringgetEnvironmentTeardownUnix()Get environment tear down for unix.protected StringgetEnvironmentTeardownWin()Get environment tear down for windows.protected StringgetExecutePreambleUnix()Get execute preamble for unix.protected StringgetExecutePreambleWin()Get execute preamble for windows.protected StringgetExternalResultsFilename()Get option to Use as external result filename.protected JenkinsgetInstance()Get Jenkins instance.protected StringgetJobName()Get the user-specified job name.protected StringgetManageProjectName()Get manage project name.protected LonggetMaxParallel()Get for maxParallel to control maximum number of jobs to be queue at at any one point.protected StringgetNodeLabel()Get node label.protected booleangetOptionClean()Get option to clean workspace before build.protected intgetOptionErrorLevel()Get error level.protected booleangetOptionExecutionReport()Use execution report.protected StringgetOptionHTMLBuildDesc()Use HTML Build Description.protected booleangetOptionUseReporting()Get use Jenkins reporting option.protected StringgetPclpCommand()Get pc-lint plus command.protected StringgetPclpResultsPattern()Get pc-lint plus result pattern.protected URLgetPipelineConfigParametersXML()Call to get baseline config.xml with parameters for pipeline job .protected URLgetPipelineConfigXML()Call to get baseline config.xml for pipeline job .StringgetProjectName()Get the name of the project.protected org.kohsuke.stapler.StaplerRequestgetRequest()Get request.protected org.kohsuke.stapler.StaplerResponsegetResponse()Get response.protected StringgetSquoreCommand()Get command for running Squore.protected StringgetTestInsightsCredentialsId()Get Credentials for TESTinsights.protected StringgetTestInsightsProject()Get Project for TESTinsights.protected StringgetTestInsightsProxy()Get Proxy for TESTinsights.protected StringgetTestInsightsScmTech()Get SCM Technology TESTinsights.protected StringgetTestInsightsScmUrl()Get SCM URL for TESTinsights.protected StringgetTestInsightsUrl()Get URL for TESTinsights.protected Project<?,?>getTopProject()Get top-level project.protected booleangetUseCILicenses()Get option to use CI licenses.protected StringgetUseCILicensesUnix()Get use CI license for Linux.protected StringgetUseCILicensesWin()Get use CI license for Linux.booleangetUseCoverageHistory()Get option to Use coverage history to control build status.protected booleangetUseCoveragePlugin()Get option to use coverage plugin or vectorcast coverage plugin.protected booleangetUseExternalImportedResults()Get option to Use external imported results.protected booleangetUseImportedResults()Get option to Use imported results.protected booleangetUseLocalImportedResults()Get option to Use local imported results.protected booleangetUseRGW3()Get option to Use RGW3 capabilities.protected booleangetUseStrictTestcaseImport()Get option to Use strict testcase import.protected LonggetWaitLoops()Get the number of wait loops.protected LonggetWaitTime()Get the time to wait between retries.protected booleanisUsingScm()Using some form of SCM.voidsetProjectName(String pName)Sets the name of the project.protected voidsetTestInsightsProject(String project)set Project for TESTinsights.protected voidsetTestInsightsScmTech(String tech)Set SCM Technology TESTinsights.protected voidsetTestInsightsScmUrl(String url)Set SCM URL for TESTinsights.protected voidsetUsingSCM(boolean useScm)Set using some form of SCM.
-
-
-
Constructor Detail
-
BaseJob
protected BaseJob(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse resp) throws javax.servlet.ServletException, IOException, ExternalResultsFileException, IllegalArgumentException, BadOptionComboExceptionConstructor.- Parameters:
req- request objectresp- response object- Throws:
javax.servlet.ServletException- exceptionIOException- exceptionExternalResultsFileException- exceptionIllegalArgumentException- exceptionBadOptionComboException- exception
-
-
Method Detail
-
isUsingScm
protected boolean isUsingScm()
Using some form of SCM.- Returns:
- true or false
-
setUsingSCM
protected void setUsingSCM(boolean useScm)
Set using some form of SCM.- Parameters:
useScm- true/false
-
getEnvironmentSetupWin
protected String getEnvironmentSetupWin()
Get environment setup for windows.- Returns:
- setup
-
getExecutePreambleWin
protected String getExecutePreambleWin()
Get execute preamble for windows.- Returns:
- preamble
-
getEnvironmentTeardownWin
protected String getEnvironmentTeardownWin()
Get environment tear down for windows.- Returns:
- environment tear down for windows
-
getEnvironmentSetupUnix
protected String getEnvironmentSetupUnix()
Get environment setup for unix.- Returns:
- environment setup
-
getExecutePreambleUnix
protected String getExecutePreambleUnix()
Get execute preamble for unix.- Returns:
- preamble
-
getEnvironmentTeardownUnix
protected String getEnvironmentTeardownUnix()
Get environment tear down for unix.- Returns:
- teardown
-
getOptionUseReporting
protected boolean getOptionUseReporting()
Get use Jenkins reporting option.- Returns:
- true to use, false to not
-
getOptionErrorLevel
protected int getOptionErrorLevel()
Get error level.- Returns:
- int 0 - Do nothing, 1 - Unstable, 2 - Error
-
getOptionHTMLBuildDesc
protected String getOptionHTMLBuildDesc()
Use HTML Build Description.- Returns:
- HTML or TEXT
-
getOptionExecutionReport
protected boolean getOptionExecutionReport()
Use execution report.- Returns:
- true to use, false to not
-
getOptionClean
protected boolean getOptionClean()
Get option to clean workspace before build.- Returns:
- true to clean, false to not
-
getUseCILicenses
protected boolean getUseCILicenses()
Get option to use CI licenses.- Returns:
- true to use CI licenses, false to not
-
getUseStrictTestcaseImport
protected boolean getUseStrictTestcaseImport()
Get option to Use strict testcase import.- Returns:
- true to Use strict testcase import, false to not
-
getUseRGW3
protected boolean getUseRGW3()
Get option to Use RGW3 capabilities.- Returns:
- true use RGW3 capabilities, false to not
-
getUseCoveragePlugin
protected boolean getUseCoveragePlugin()
Get option to use coverage plugin or vectorcast coverage plugin.- Returns:
- true use coverage plugin or vectorcast coverage plugin
-
getUseImportedResults
protected boolean getUseImportedResults()
Get option to Use imported results.- Returns:
- true to Use imported results, false to not
-
getUseLocalImportedResults
protected boolean getUseLocalImportedResults()
Get option to Use local imported results.- Returns:
- true to Use local imported results, false to not
-
getUseExternalImportedResults
protected boolean getUseExternalImportedResults()
Get option to Use external imported results.- Returns:
- true to Use external imported results, false to not
-
getExternalResultsFilename
protected String getExternalResultsFilename()
Get option to Use as external result filename.- Returns:
- string external result filename
-
getUseCoverageHistory
public boolean getUseCoverageHistory()
Get option to Use coverage history to control build status.- Returns:
- true to Use imported results, false to not
-
getMaxParallel
protected Long getMaxParallel()
Get for maxParallel to control maximum number of jobs to be queue at at any one point.- Returns:
- MaxParallel integer number
-
getUseCILicensesWin
protected String getUseCILicensesWin()
Get use CI license for Linux.- Returns:
- String command to set
-
getUseCILicensesUnix
protected String getUseCILicensesUnix()
Get use CI license for Linux.- Returns:
- String command to set
-
getWaitTime
protected Long getWaitTime()
Get the time to wait between retries.- Returns:
- number of seconds
-
getWaitLoops
protected Long getWaitLoops()
Get the number of wait loops.- Returns:
- number of iterations
-
getJobName
protected String getJobName()
Get the user-specified job name.- Returns:
- job name (null for use default)
-
getTopProject
protected Project<?,?> getTopProject()
Get top-level project.- Returns:
- project
-
getManageProjectName
protected String getManageProjectName()
Get manage project name.- Returns:
- manage project name
-
getBaseName
protected String getBaseName()
Get base name of manage project.- Returns:
- base name
-
getNodeLabel
protected String getNodeLabel()
Get node label.- Returns:
- node label
-
getPclpCommand
protected String getPclpCommand()
Get pc-lint plus command.- Returns:
- pc-lint plus command
-
getPclpResultsPattern
protected String getPclpResultsPattern()
Get pc-lint plus result pattern.- Returns:
- pc-lint plus result pattern
-
getSquoreCommand
protected String getSquoreCommand()
Get command for running Squore.- Returns:
- Squore command
-
getTestInsightsUrl
protected String getTestInsightsUrl()
Get URL for TESTinsights.- Returns:
- TESTinsights URL
-
getTestInsightsProject
protected String getTestInsightsProject()
Get Project for TESTinsights.- Returns:
- TESTinsights Project
-
setTestInsightsProject
protected void setTestInsightsProject(String project)
set Project for TESTinsights.- Parameters:
project- TESTinsights Project
-
getTestInsightsProxy
protected String getTestInsightsProxy()
Get Proxy for TESTinsights.- Returns:
- proxy TESTinsights proxy
-
getTestInsightsCredentialsId
protected String getTestInsightsCredentialsId()
Get Credentials for TESTinsights.- Returns:
- TESTinsights Credentials
-
setTestInsightsScmUrl
protected void setTestInsightsScmUrl(String url)
Set SCM URL for TESTinsights.- Parameters:
url- TESTinsights SCM URL
-
getTestInsightsScmUrl
protected String getTestInsightsScmUrl()
Get SCM URL for TESTinsights.- Returns:
- TESTinsights SCM URL
-
getTestInsightsScmTech
protected String getTestInsightsScmTech()
Get SCM Technology TESTinsights.- Returns:
- TESTinsights SCM Technology
-
setTestInsightsScmTech
protected void setTestInsightsScmTech(String tech)
Set SCM Technology TESTinsights.- Parameters:
tech- TESTinsights SCM Technology
-
getRequest
protected org.kohsuke.stapler.StaplerRequest getRequest()
Get request.- Returns:
- request
-
getInstance
protected Jenkins getInstance()
Get Jenkins instance.- Returns:
- Jenkins instance
-
getProjectName
public String getProjectName()
Get the name of the project.- Returns:
- the project name
-
setProjectName
public void setProjectName(String pName)
Sets the name of the project.- Parameters:
pName- - project name
-
getResponse
protected org.kohsuke.stapler.StaplerResponse getResponse()
Get response.- Returns:
- response
-
addDelWSBeforeBuild
protected void addDelWSBeforeBuild(Project<?,?> project)
Add the delete workspace before build starts option.- Parameters:
project- project to add to
-
create
@POST public void create() throws IOException, javax.servlet.ServletException, Descriptor.FormException, JobAlreadyExistsException, InvalidProjectFileException, AccessDeniedException3Create the job(s).- Throws:
IOException- exceptionjavax.servlet.ServletException- exceptionDescriptor.FormException- exceptionJobAlreadyExistsException- exceptionInvalidProjectFileException- exceptionAccessDeniedException3- exception
-
createProject
protected abstract Project<?,?> createProject() throws IOException, JobAlreadyExistsException
Create top-level project.- Returns:
- created project
- Throws:
IOException- exceptionJobAlreadyExistsException- exception
-
cleanupProject
protected abstract void cleanupProject()
Cleanup top-level project, as in delete.
-
doCreate
@POST protected abstract void doCreate() throws IOException, javax.servlet.ServletException, Descriptor.FormException, InvalidProjectFileExceptionDo create of project details.- Throws:
IOException- exceptionjavax.servlet.ServletException- exceptionDescriptor.FormException- exceptionInvalidProjectFileException- exception
-
addSetup
protected VectorCASTSetup addSetup(Project<?,?> project) throws IOException
Add the VectorCAST setup step to copy the python scripts to. the workspace- Parameters:
project- project- Returns:
- the setup build step
- Throws:
IOException
-
addArchiveArtifacts
protected void addArchiveArtifacts(Project<?,?> project)
Add archive artifacts step.- Parameters:
project- project to add to
-
addCopyResultsToImport
protected void addCopyResultsToImport(Project<?,?> project)
Add archive artifacts step.- Parameters:
project- project to add to
-
addJunit
protected void addJunit(Project<?,?> project)
Add JUnit rules step.- Parameters:
project- project to add step to
-
addPCLintPlus
protected void addPCLintPlus(Project<?,?> project)
Add PC-Lint Plus step.- Parameters:
project- project to add step to do PC-Lint Plus
-
addVCCoverage
protected void addVCCoverage(Project<?,?> project)
Add VectorCAST coverage reporting step.- Parameters:
project- project to add step to
-
addReferenceBuild
protected void addReferenceBuild(Project<?,?> project)
Add Jenkins coverage reporting step.- Parameters:
project- project to add step to
-
addJenkinsCoverage
protected void addJenkinsCoverage(Project<?,?> project)
Add Jenkins coverage reporting step.- Parameters:
project- project to add step to
-
addCredentialID
protected void addCredentialID(Project<?,?> project)
Add credentials for coverage reporting step.- Parameters:
project- project to add step to
-
getBaselineWindowsSingleFile
protected URL getBaselineWindowsSingleFile()
Call to get baseline windows single job file.- Returns:
- URL for baseline file
-
getBaselineLinuxSingleFile
protected URL getBaselineLinuxSingleFile()
Call to get baseline linux single job file.- Returns:
- URL for baseline file
-
getBaselinePostBuildGroovyScript
protected URL getBaselinePostBuildGroovyScript()
Call to get baseline post-build groovy job file.- Returns:
- URL for baseline file
-
getPipelineConfigParametersXML
protected URL getPipelineConfigParametersXML()
Call to get baseline config.xml with parameters for pipeline job .- Returns:
- URL for baseline file
-
getPipelineConfigXML
protected URL getPipelineConfigXML()
Call to get baseline config.xml for pipeline job .- Returns:
- URL for baseline file
-
getBaselinePipelineGroovy
protected URL getBaselinePipelineGroovy()
Call to get baseline groovy script for pipeline job.- Returns:
- URL for baseline file
-
-