DevOps - Experiment No 6
DevOps - Experiment No 6
Aim: The aim of this experiment is to set up a local Jenkins CI pipeline that automatically
builds,tests, and packages Java applications using Maven or Gradle—demonstrating how
continuous integration can improve code quality and streamline development workflows.
Procedure:
Go to "Manage Jenkins"
Select "Plugins(Available Plugins)"
Select:Maven Integration Plugin,Gradle plugin,Pipeline and Junit and click "Install"
For Maven:
1. Go to "Manage Jenkins"
2. Select "tools"
3. Go to "Maven Installations"
"MAVEN_HOME: /usr/share/maven"
Save changes.
Configure Source Code Management (SCM):In the job configuration page,
For Gradle:
1. Go to "Manage Jenkins"
2. Select "tools"
3. Go to "Gradle Installations"
cd /home/klecet/gradle-projects
cd /home/klecet/gradle-projects
/opt/gradle/gradle-8.4/bin/gradle clean test
pipeline {
agent any
stages {
stage('Hello') {
steps {
Output:
Output:
For Maven:
Output:
For Gradle:
Output:
For Maven:
Output:
For Gradle:
Output:
Console log:
[Pipeline] stage
[Pipeline] { (Hello)
[Pipeline] echo
Hello World
[Pipeline] }