Jenkins - Run job when new slave connects Jenkins - Run job when new slave connects jenkins jenkins

Jenkins - Run job when new slave connects


We use the Slave Setup Plugin to mount a network drive and copy some files from the master whenever a slave connects.

If you want to run certain Jenkins jobs whenever a slave (or certain slave) connects, you could try the Startup Trigger Plugin.


There is the EC2 plugin which will spin up slaves on your behalf and run an init script on them for you.

Init script is the shell script to be run on the newly launched EC2 instance, before Jenkins starts launching a slave agent. If the AMI doesn't have Java pre-installed, you can do this in the init script. This is also a good place to install additional packages that you need for your builds and tests. The init script is located at /tmp/init.sh and is owned and run by the user account specified in the "Remote User" field (so use of "sudo" may be required for non-root accounts).