Qasim Ali
Qasim Ali

Reputation: 107

Which build action to chose to execute Groovy scripts on jenkins slave JVM

I am able to execute Groovy scripts on slave JVM using the slave's groovy console offered by Jenkins. (e.g) println System.getenv("PATH")

prints the value of path variable of the slave node

when I made the same call in my Jenkins job which is executed on slave, using build action execute system groovy script It creates the workspace on slave but groovy script is executed in server JVM (e.g) println System.getenv("PATH")

prints the value of path variable at the Master's Node

Is there any way of executing my groovy scripts on client JVM in Jenkins job without installing groovy on slave node?

Upvotes: 1

Views: 655

Answers (1)

nash
nash

Reputation: 3110

On the main Jenkins screen click on the slave you want to run the script on and add script to the end of the url. This should load the script console for that slave.

If my base Jenkins url is jenkinsurl then on my setup the script console for my windows slave is jenkinsurl/computer/Windows/script.

Upvotes: 0

Related Questions