Created
October 12, 2016 21:12
-
-
Save mllrjb/f3be6a1e6c63bcdf52bef84832563ce3 to your computer and use it in GitHub Desktop.
Jenkins init.groovy.d Ant Installer
This file contains 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.model.* | |
import hudson.tasks.* | |
import hudson.tools.* | |
def inst = Jenkins.getInstance() | |
def desc = inst.getDescriptor("hudson.tasks.Ant") | |
def versions = [ | |
"ant-1.9": "1.9.7" | |
] | |
def installations = []; | |
for (v in versions) { | |
def installer = new Ant.AntInstaller(v.value) | |
def installerProps = new InstallSourceProperty([installer]) | |
def installation = new Ant.AntInstallation(v.key, "", [installerProps]) | |
installations.push(installation) | |
} | |
desc.setInstallations(installations.toArray(new Ant.AntInstallation[0])) | |
desc.save() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment