Skip to content

Custom Jenkins slave agents

Deepak Narayana Rao edited this page Oct 11, 2017 · 2 revisions

A slave is a Docker container running and connected to Jenkins via the Jenkins Slave plugin.

Generic slave agent

A generic slave agent is available for running Jenkins jobs. The slave agent is based off vfarcic/jenkins-swarm-agent (Ref:https://github.com/vfarcic/docker-jenkins-slave-dind). Any job which needs to run on this slave needs to restrict the job to run on label: general-{env}. Any job which has simple job dependencies can have a pre-build stage, where the software(s) can be installed. Note that the image is build on Alpine, so you will need to use apk and not apt or yum for software installations. You may refer to https://github.com/project-sunbird/sunbird-devops/tree/master/pipelines for various pipeline definitions.

Custom slave agents

Sometimes, the dependencies may not be generic and cumbersome to install for every execution of the job. In such scenarios, you may build a custom slave agent by writing a slave Dockerfile. Examples of custom slave agents are:

Operational aspects

You may need to just define your slave Dockerfile and hand it over to the DevOps team. Soon, this process of registry will be automated.

Clone this wiki locally