0% found this document useful (0 votes)
9 views30 pages

Experiment - 6 Procedure

This document outlines the steps for setting up a Continuous Integration (CI) pipeline using Jenkins, including the installation of Git and integration with Maven/Gradle. It provides a detailed guide on configuring Jenkins, installing necessary plugins, creating a new job, and generating a pipeline script for building projects. The final steps include executing the build and verifying the output in the Jenkins workspace.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views30 pages

Experiment - 6 Procedure

This document outlines the steps for setting up a Continuous Integration (CI) pipeline using Jenkins, including the installation of Git and integration with Maven/Gradle. It provides a detailed guide on configuring Jenkins, installing necessary plugins, creating a new job, and generating a pipeline script for building projects. The final steps include executing the build and verifying the output in the Jenkins workspace.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

Experiment 6: Continuous Integration with Jenkins: Setting Up a CI

Pipeline, Integrating Jenkins with Maven/Gradle, Running Automated


Builds and Tests
Prerequisite: Create “GitHub” account and install and configure “git” in local machine
INSTALLATION OF GIT
Step 1: search for “install git” and click on download link
Step 2: Select OS for which git needs to be installed
Step 3: select the installer which is appropriate for your system

Click on this for windows 64-bit


Step 4: Double click on the downloaded file to begin with installation
Step 5: Follow the steps to continue with installation
Step 6: After completion of installation, Run “git --version” in command prompt to verify the installation of git.
CI/CD SET UP IN JENKINS
Step 1: Sign in to Jenkins
Step 2: In the Jenkins dashboard click on “Manage Jenkins”
Step 3: In the “Manage Jenkins” window click on “Plugins”
Step 4: In “Plugins” window click on “Available plugins” → Search for “Pipeline:Stage View” → select “Pipeline:Stage
View” → click on “Install”
Look for the successful installation of plugin
Step 5: Go to main Dashboard of Jenkins → click on “New Item” or “Create a Job”
Step 6: Provide Project/item name → select Item type → click on “OK”
Step 7: Provide Description(optional)

Scroll down in this window


Step 8: Select “GitHub hook trigger for GITScm polling”

Scroll down in this window


Step 9: Under “Pipeline”, select “Pipeline script” → select “Hello world” or “try sample Pipeline” → click on “Pipeline
Syntax”
Pipeline Syntax window appears as follows
Step 10: under “Sample Step” select “git: Git” form drop down → under “Repository URL” provide project’s git
repository URL → under “Branch” select branch name, usually “main”

Scroll down in this window


Step 11: Click on “Generate Pipeline Script” → copy generated script
Step 12: Go back to project configuration window → make changes as in the following image

This stage draws/downloads Name of the stage: SCM


project code and other
dependency files from the
source code management
tool github.
Paste generated pipeline script
make changes as in the following image and click on “Apply” and “Save”

This stage creates “target” Name of the stage


directory using project files
downloaded in previous stage.
Inside this .jar/.war file of the
Command to create a .war file
project will created.
Step 13: go to project window and click on “Build Now”
Observe building of different stages according to pipeline script
Step 14: Completion of building stages of the project will appear as below → click on build number under “Builds” to
know Console Output of build

Build number
Step 15: Console Output shows complete build details.
Step 15: go to “C:\Users\<your system user>\.jenkins\workspace” to verify the built projects; click on your project
Check for file and folders of the project; verify the creation of “target” folder inside which “.war” will be available

You might also like