Package org.jenkinsci.plugins.codesonar
Class CodeSonarJobDslExtension
java.lang.Object
javaposse.jobdsl.plugin.ContextExtensionPoint
org.jenkinsci.plugins.codesonar.CodeSonarJobDslExtension
- All Implemented Interfaces:
ExtensionPoint
@Extension(optional=true)
public class CodeSonarJobDslExtension
extends javaposse.jobdsl.plugin.ContextExtensionPoint
Implement extension point for job-dsl plugin.
The job-dsl plugin allows one to generate new Jenkins projects from a script. This extension point implementation allows one to declare the use of the CodeSonar plugin in their job-dsl script.
This is the general structure:
job {
publishers {
codesonar(String protocol, String hubAddress, String projectName, String credentialId, String visibilityFilter) {
socketTimeoutMS(int value)
sslCertificateCredentialId(String value)
projectFile(String value)
newWarningsFilter(String value)
comparisonAnalysis(String value)
cyclomaticComplexity(int max, boolean fail)
redAlert(int max, boolean fail)
yellowAlert(int max, boolean fail)
newWarningCountIncrease(float percentage, boolean fail)
overallWarningCountIncrease(float percentage, boolean fail)
rankedWarningCountIncrease(int rank, float percentage, boolean fail)
absoluteWarningCount(int rank, int count, boolean fail)
}
}
}
For example:
job('myProject_GEN') {
publishers {
codesonar('https','codesonarhub.com:7340','MyProjectName','codesonar_hub_credential_id','active') {
socketTimeoutMS(0)
sslCertificateCredentialId('codesonar_hub_server_certificate_id')
projectFile('MyProjectFile')
newWarningsFilter('new')
comparisonAnalysis('MyBaseAnalysisId')
cyclomaticComplexity(20, false)
redAlert(3, true)
yellowAlert(10, false)
newWarningCountIncrease(5.0, true)
overallWarningCountIncrease(5.0, false)
rankedWarningCountIncrease(30, 5.0, true)
absoluteWarningCount(20,10,false)
}
}
}
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class javaposse.jobdsl.plugin.ContextExtensionPoint
all, executeInContext, notifyItemCreated, notifyItemUpdated
-
Constructor Details
-
CodeSonarJobDslExtension
public CodeSonarJobDslExtension()
-
-
Method Details
-
codesonar
-
codesonar
-