Created
October 21, 2014 13:46
-
-
Save aespinosa/ea9326cc9fa9c6dd9e71 to your computer and use it in GitHub Desktop.
all-in-one Jenkins configuration
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.*; | |
pm = Jenkins.instance.pluginManager | |
pm.doCheckUpdatesServer() | |
plugins = pm.plugins | |
# FIXME idempotency needed here | |
plugins.each { | |
if (it.isEnabled()) { | |
it.disable() | |
} | |
} | |
# Idempotency check | |
if (! pm.getPlugin("git") { | |
deployment = Jenkins.instance.updateCenter.getPlugin("git").deploy(true) | |
deployment.get() | |
} | |
def deployPlugin(plugin) { | |
if (! plugin.isEnabled() ) { | |
plugin.enable() | |
} | |
plugin.getDependencies().each { | |
deployPlugin(pm.getPlugin(it.shortName)) | |
} | |
} | |
plugin = pm.getPlugin("git") | |
deployPlugin(plugin) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment