How can I lock and unlock Jenkins slave? Pseudo code like this.
for (slave in hudson.model.Hudson.instance.slaves) {
if (slave.getNodeName() == "slave_need_to_be_lock") {
Computer c = slave.getComputer();
c.lock();
c.unlock();
}
}
How can I lock and unlock Jenkins slave? Pseudo code like this.
for (slave in hudson.model.Hudson.instance.slaves) {
if (slave.getNodeName() == "slave_need_to_be_lock") {
Computer c = slave.getComputer();
c.lock();
c.unlock();
}
}
I work it out with following code.