Reputation: 293
Does someone know Jenkins' Job-DSL syntax to configure SonarQube's quality gate plugin section?
Upvotes: 1
Views: 986
Reputation: 293
One can use the Configure block of Job DSL to define custom elements. A related question is Using Jenkins Job-DSL Configure block to place custom steps in particular positions.
The following script worked for me,
configure { project ->
project / publishers / 'quality.gates.jenkins.QGPublisher' (plugin:'[email protected]'){
jobConfigData{
projectKey('MY-PROJECT-ID')
sonarInstanceName('SonarQube')
}
}
}
The script can be tested using "Job DSL playground" at http://job-dsl.herokuapp.com/
Upvotes: 2