Created
December 8, 2017 11:34
-
-
Save nehaljwani/3f267cd72b471b221fa7061c36981368 to your computer and use it in GitHub Desktop.
Jenkins System Groovy: Add k8s node
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 hudson.model.Label | |
toProvision = 5 | |
podLabel = Label.get('el6') | |
cloud = Jenkins.instance.clouds.find { it.canProvision(podLabel) } | |
cloud.provision(podLabel, toProvision).collect().each { | |
node = it.future.get() | |
Jenkins.instance.addNode(node) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment