0
0
Jenkinsdevops~30 mins

Parallel stages execution in Jenkins - Mini Project: Build & Apply

Choose your learning style9 modes available
Parallel stages execution
📖 Scenario: You are setting up a Jenkins pipeline to run multiple tasks at the same time. This helps finish work faster, like cooking several dishes together instead of one after another.
🎯 Goal: Build a Jenkins pipeline script that runs two stages in parallel: Build and Test. Each stage should print a simple message.
📋 What You'll Learn
Create a Jenkins pipeline with a pipeline block
Add a stages block inside the pipeline
Inside stages, add a parallel block with two stages named Build and Test
Each stage should have a steps block with a echo command printing exactly Building project... or Testing project...
The pipeline should run both stages at the same time
💡 Why This Matters
🌍 Real World
In real software projects, running build and test tasks in parallel speeds up delivery. Jenkins pipelines help automate this process.
💼 Career
DevOps engineers use Jenkins pipelines with parallel stages to optimize CI/CD workflows and improve software release speed.
Progress0 / 4 steps
1
Create the basic Jenkins pipeline structure
Write a Jenkins pipeline script starting with pipeline { and inside it add an empty stages { } block.
Jenkins
Need a hint?

Start with pipeline { and add stages { } inside it.

2
Add a parallel block with two stages
Inside the stages block, add a parallel { } block containing two stages named Build and Test. Leave their steps blocks empty for now.
Jenkins
Need a hint?

Use parallel { } inside stages and add two stage blocks named Build and Test.

3
Add echo steps to each parallel stage
Inside the steps block of the Build stage, add echo 'Building project...'. Inside the steps block of the Test stage, add echo 'Testing project...'.
Jenkins
Need a hint?

Use echo inside each steps block to print the messages.

4
Run the pipeline and check output
Run the Jenkins pipeline script and verify that the output contains both Building project... and Testing project... messages, showing the stages ran in parallel.
Jenkins
Need a hint?

Check the Jenkins console output after running the pipeline. Both messages should appear, indicating parallel execution.