Mark node offline on build failure

535 views
Skip to first unread message

Jacqueline Taing

unread,
Feb 11, 2016, 7:43:14 PM2/11/16
to Jenkins Users
Is there a way to mark a node offline via DSL. We currently use Build Flow Plugin to define jobs and I'd like to automatically take a node offline when a build fails (so other jobs do not get queued/run on this slave).

Thanks!

Gurusharan S

unread,
Feb 21, 2016, 11:53:27 AM2/21/16
to Jenkins Users
Hello Jackqueline,

Have you considered using jenkins CLI for this? From the CLI doc:
java -jar jenkins-cli.jar -s http://localhost:8080/jenkins/ disconnect-node NAME [-m VAL]
Disconnects from a node.

NAME : Slave name, or empty string for master -m VAL : Record the note about why you are disconnecting this node

However, this cannot be invoked directly as a build step - you can consider using a post-build script or a separate job (running on the master) for this that can be triggered with a delay automatically or using upstream/downstream projects.

Hope this helps.

Bye for now,
Gurusharan S.

Victor Martinez

unread,
Feb 21, 2016, 3:38:45 PM2/21/16
to Jenkins Users
You might use the below plugin:

but I don't know whether it's already supported by that plugin...
Reply all
Reply to author
Forward
0 new messages