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 protected
BaseJob(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 void
addArchiveArtifacts(Project<?,?> project)
Add archive artifacts step.protected void
addCopyResultsToImport(Project<?,?> project)
Add archive artifacts step.protected void
addCredentialID(Project<?,?> project)
Add credentials for coverage reporting step.protected void
addDelWSBeforeBuild(Project<?,?> project)
Add the delete workspace before build starts option.protected void
addJenkinsCoverage(Project<?,?> project)
Add Jenkins coverage reporting step.protected void
addJunit(Project<?,?> project)
Add JUnit rules step.protected void
addPCLintPlus(Project<?,?> project)
Add PC-Lint Plus step.protected void
addReferenceBuild(Project<?,?> project)
Add Jenkins coverage reporting step.protected VectorCASTSetup
addSetup(Project<?,?> project)
Add the VectorCAST setup step to copy the python scripts to.protected void
addVCCoverage(Project<?,?> project)
Add VectorCAST coverage reporting step.protected abstract void
cleanupProject()
Cleanup top-level project, as in delete.void
create()
Create the job(s).protected abstract Project<?,?>
createProject()
Create top-level project.protected abstract void
doCreate()
Do create of project details.protected URL
getBaselineLinuxSingleFile()
Call to get baseline linux single job file.protected URL
getBaselinePipelineGroovy()
Call to get baseline groovy script for pipeline job.protected URL
getBaselinePostBuildGroovyScript()
Call to get baseline post-build groovy job file.protected URL
getBaselineWindowsSingleFile()
Call to get baseline windows single job file.protected String
getBaseName()
Get base name of manage project.protected String
getEnvironmentSetupUnix()
Get environment setup for unix.protected String
getEnvironmentSetupWin()
Get environment setup for windows.protected String
getEnvironmentTeardownUnix()
Get environment tear down for unix.protected String
getEnvironmentTeardownWin()
Get environment tear down for windows.protected String
getExecutePreambleUnix()
Get execute preamble for unix.protected String
getExecutePreambleWin()
Get execute preamble for windows.protected String
getExternalResultsFilename()
Get option to Use as external result filename.protected Jenkins
getInstance()
Get Jenkins instance.protected String
getJobName()
Get the user-specified job name.protected String
getManageProjectName()
Get manage project name.protected Long
getMaxParallel()
Get for maxParallel to control maximum number of jobs to be queue at at any one point.protected String
getNodeLabel()
Get node label.protected boolean
getOptionClean()
Get option to clean workspace before build.protected int
getOptionErrorLevel()
Get error level.protected boolean
getOptionExecutionReport()
Use execution report.protected String
getOptionHTMLBuildDesc()
Use HTML Build Description.protected boolean
getOptionUseReporting()
Get use Jenkins reporting option.protected String
getPclpCommand()
Get pc-lint plus command.protected String
getPclpResultsPattern()
Get pc-lint plus result pattern.protected URL
getPipelineConfigParametersXML()
Call to get baseline config.xml with parameters for pipeline job .protected URL
getPipelineConfigXML()
Call to get baseline config.xml for pipeline job .String
getProjectName()
Get the name of the project.protected org.kohsuke.stapler.StaplerRequest
getRequest()
Get request.protected org.kohsuke.stapler.StaplerResponse
getResponse()
Get response.protected String
getSquoreCommand()
Get command for running Squore.protected String
getTestInsightsCredentialsId()
Get Credentials for TESTinsights.protected String
getTestInsightsProject()
Get Project for TESTinsights.protected String
getTestInsightsProxy()
Get Proxy for TESTinsights.protected String
getTestInsightsScmTech()
Get SCM Technology TESTinsights.protected String
getTestInsightsScmUrl()
Get SCM URL for TESTinsights.protected String
getTestInsightsUrl()
Get URL for TESTinsights.protected Project<?,?>
getTopProject()
Get top-level project.protected boolean
getUseCILicenses()
Get option to use CI licenses.protected String
getUseCILicensesUnix()
Get use CI license for Linux.protected String
getUseCILicensesWin()
Get use CI license for Linux.boolean
getUseCoverageHistory()
Get option to Use coverage history to control build status.protected boolean
getUseCoveragePlugin()
Get option to use coverage plugin or vectorcast coverage plugin.protected boolean
getUseExternalImportedResults()
Get option to Use external imported results.protected boolean
getUseImportedResults()
Get option to Use imported results.protected boolean
getUseLocalImportedResults()
Get option to Use local imported results.protected boolean
getUseRGW3()
Get option to Use RGW3 capabilities.protected boolean
getUseStrictTestcaseImport()
Get option to Use strict testcase import.protected Long
getWaitLoops()
Get the number of wait loops.protected Long
getWaitTime()
Get the time to wait between retries.protected boolean
isUsingScm()
Using some form of SCM.void
setProjectName(String pName)
Sets the name of the project.protected void
setTestInsightsProject(String project)
set Project for TESTinsights.protected void
setTestInsightsScmTech(String tech)
Set SCM Technology TESTinsights.protected void
setTestInsightsScmUrl(String url)
Set SCM URL for TESTinsights.protected void
setUsingSCM(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, BadOptionComboException
Constructor.- 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, AccessDeniedException3
Create 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, InvalidProjectFileException
Do 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
-
-