Created
January 20, 2020 17:45
-
-
Save AtnNn/9e29fc8515d659454ef99b5300369666 to your computer and use it in GitHub Desktop.
Jenkins groovy script; run command on each slave
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
// Run from https://jenkins/script | |
import hudson.util.RemotingDiagnostics; | |
cmd = 'def proc = ["conan", "--version"].execute(); proc.waitFor(); println proc.in.text'; | |
for (slave in hudson.model.Hudson.instance.slaves) { | |
if (slave.name ==~ /^build-slave[0-9]/) { | |
println slave.name; | |
println RemotingDiagnostics.executeGroovy(cmd, slave.getChannel()); | |
} | |
} | |
Delete folders:
println new File("c:\\path").deleteDir()
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uploading files: