Created
July 11, 2018 09:00
-
-
Save willis7/e5c74f4ca81fb7b2b4ed52ea66800ca0 to your computer and use it in GitHub Desktop.
Add the Sonar installation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jenkins.model.* | |
import hudson.plugins.sonar.* | |
import hudson.plugins.sonar.model.* | |
def inst = Jenkins.getInstance() | |
def desc = inst.getDescriptor("hudson.plugins.sonar.SonarPublisher") | |
def sinst = new SonarInstallation( | |
"[name of the sonar installation - I use the host name]", | |
[true or false to disable the sonar installation], | |
"[sonar server url]", | |
"[sonar database url]", | |
"[sonar database driver]", | |
"[sonar database user]", | |
"[sonar database password]", | |
"[version of sonar maven plugin - I don't use maven so leave this blank]", | |
"[additional properties to pass to maven - again I leave this blank]", | |
new TriggersConfig(), | |
"[sonar user]", | |
"[sonar password]" | |
) | |
desc.setInstallations(sinst) | |
desc.save() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment