Sitemap
DevOps with Valentine

DevOps can help you deliver more business value. It is not always easy but certainly possible.

Run a Pipeline on the Jenkins Controller’s Built-in Node

--

If you find yourself in a situation where you have a Jenkins setup composed of the controller and one or more agents, you will notice that the agents will be used for building the jobs — which is actually what we want.

However, there can be situations where you might want to do this.

I found the official Jenkins documentation [1] on this particular topic to be a bit confusing. While it talks about using labels to select a specific agent, it does not mention anything about running pipelines on the controller.

A quick look at the available nodes will reveal that the built-in node does not have a label visible.

However, the approach I’ve found to be working is by specifying the label built-in as shown in the example below:

pipeline {
agent { label 'built-in' }

stages {
stage ('Test') {
steps {
sh """
echo "Test"
"""
}
}
}
post {
always {
cleanWs()
}
}
}

As you can observe from the execution logs, this pipeline was then executed on the built-in node.

References:

[1] https://www.jenkins.io/doc/book/pipeline/syntax/#agent

--

--

DevOps with Valentine
DevOps with Valentine

Published in DevOps with Valentine

DevOps can help you deliver more business value. It is not always easy but certainly possible.

Valentin Despa
Valentin Despa

Written by Valentin Despa

Software developer, educator & overlander • GitLab Hero • AWS Community Builder • Postman Supernova • Imprint: http://vdespa.com/imprint

No responses yet