0% found this document useful (0 votes)
44 views

Lab 7 - Jenkins (Devops, Ci/Cd Tool)

Jenkins is an open source tool used for continuous integration and continuous delivery. It allows building and testing software projects automatically whenever code changes are pushed to the repository. The document describes setting up Jenkins using Docker and then configuring two jobs - the first job builds a C++ "hello world" program whenever code is pushed to a GitHub repository, and the second job runs the built program. Screenshots must be provided after successfully setting up Jenkins, capturing the build output, and the job history.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views

Lab 7 - Jenkins (Devops, Ci/Cd Tool)

Jenkins is an open source tool used for continuous integration and continuous delivery. It allows building and testing software projects automatically whenever code changes are pushed to the repository. The document describes setting up Jenkins using Docker and then configuring two jobs - the first job builds a C++ "hello world" program whenever code is pushed to a GitHub repository, and the second job runs the built program. Screenshots must be provided after successfully setting up Jenkins, capturing the build output, and the job history.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

CLOUD COMPUTING LAB

Lab 7 – Jenkins (DevOps, CI/CD tool)


Introduction:
Welcome to Lab 7! This simple exercise is designed to introduce you to Jenkins and
continuous integration.
General Instructions:
1. All the screenshots must be uploaded to Edmodo before the stipulated deadline.
2. For each lab, screenshots need to be uploaded as mentioned under the
“deliverables” section for each task exactly as mentioned.
3. If a task has some questions, these will not be evaluated but are extremely
important in understanding the concepts.
4. Try to solve the tasks by yourselves, all relevant information to complete the tasks
has been provided. In case you are stuck and not able to solve the issue, feel free to
send email to [email protected]

What is Jenkins?

Jenkins is an extensible, open source continuous integration server. It builds and


tests your software continuously and monitors the execution and status of remote jobs,
making it easier for team members and users to regularly obtain the latest stable code.

What is Jenkins Pipeline?

In simple words, Jenkins Pipeline is a combination of plugins that support the integration
and implementation of continuous delivery pipelines using Jenkins.The pipeline as Code
describes a set of features that allow Jenkins users to define pipelined job processes with
code, stored and versioned in a source repository.
CLOUD COMPUTING LAB

Overview of the Experiment

● Setup jenkins Using Docker.


● Set up a job in Jenkins to connect to your repository and build C++ hello.cpp.
● Set up second job to run the program after the build completes.

Prerequisite:

● Docker Installed on your system. (Refer to Task1 steps in the Lab5 manual)

Task-1

Aim: Set up Jenkins using Docker.

Deliverables:

1. 1A.png ( SS of the running Docker Container)

Steps:

● You will be given a Dockerfile.


● Put that Dockerfile in a folder and open a terminal in that folder.
● Build the dockerfile using this command: “sudo docker build -t jenkins:lab7
. “
● Run your container using this command “sudo docker run -p 8080:8080
-p 50000:50000 -it jenkins:lab7” (Note down the password
shown on the terminal)
● Open URL: localhost:8080 on your browser.
● Enter the password shown on your terminal after running the container (You can set
the password to ADMIN later).
○ In case you did not note down the password displayed on the terminal, you
can find the password by connecting to the container (via “sudo docker exec
–it <container_id> /bin/bash”) and checking the file /var/Jenkins_home
/secrets/initialAdminPassword inside the container
● Integrate GitHub to Jenkins: When prompted for plugin installation, click on “Select
Plugins to Install” and then search for Github and check the github option. (This step
may take a few minutes to complete)
● Take the necessary SS.

Task-2

Aim: Set up a job in Jenkins to connect to your repository and build C++ hello.cpp.

Deliverables:
CLOUD COMPUTING LAB

1. 2A.png ( picture showing the console output after the build is successful)
2. 2B.png (picture showing the Stable state of the task in Build History of Jenkins)

Steps:

● Navigate to Jenkins server. Click New Item.


● Enter a name for your project, click Freestyle Project, then OK. Note: Please do not
include a space.
● Name this something unique so there are no collisions.
● Select github project and Enter the repository URL. Use this repository link:
https://github.com/sujeeth-cc/Lab7-Jenkins.git
● Set up Source Code Management, Select git. Enter the URL of git repository.
● Add “*/main” in Branches to build (Do not delete the existing */master branch)
● Setting up Build Triggers. Select Poll SCM.
● Set up cron job by putting in “H/2 * * * *” in the Schedule box
● Set up Build. In Add build step pull-down menu, select Execute Shell.
● Enter “make -C original“(This will run the Makefile).
● Click Save.
● Click on build now.
● Take the required SS.

You might also like