0
0
Jenkinsdevops~30 mins

Master-agent architecture in Jenkins - Mini Project: Build & Apply

Choose your learning style9 modes available
Master-agent architecture
📖 Scenario: You are setting up a Jenkins environment to automate software builds. Jenkins uses a master-agent architecture where the master controls the build process and agents run the build jobs.In this project, you will create a simple Jenkins pipeline script that defines the master and an agent node to run a build step.
🎯 Goal: Build a Jenkins pipeline script that specifies a master and an agent node, then runs a simple shell command on the agent.
📋 What You'll Learn
Create a Jenkins pipeline with a pipeline block
Define an agent with label linux
Add a stage named Build
Inside the stage, run a shell command echo "Building on agent"
💡 Why This Matters
🌍 Real World
Jenkins pipelines automate software builds and tests by distributing work from the master to multiple agent nodes.
💼 Career
Understanding master-agent architecture is essential for DevOps engineers to set up scalable CI/CD pipelines.
Progress0 / 4 steps
1
Create the pipeline block
Write a Jenkins pipeline script starting with pipeline {} block.
Jenkins
Need a hint?

The pipeline block is the root of your Jenkinsfile script.

2
Add an agent with label linux
Inside the pipeline block, add an agent section with label 'linux' to specify the agent node.
Jenkins
Need a hint?

The agent label tells Jenkins which node to run the build on.

3
Add a Build stage with a shell step
Inside the pipeline block, add a stages section with one stage named Build. Inside this stage, add a steps block that runs the shell command echo "Building on agent" using sh.
Jenkins
Need a hint?

The sh step runs shell commands on the agent node.

4
Print the pipeline script
Print the entire Jenkins pipeline script you wrote.
Jenkins
Need a hint?

Use println to output confirmation text.