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

devops_ass2

This document outlines the steps to set up a CI/CD pipeline using Jenkins for automating the building, testing, and deployment of a containerized web application. It includes instructions for installing Jenkins, creating a pipeline job, configuring a GitHub repository, writing a Jenkinsfile, adding Docker credentials, and triggering the pipeline. Successful execution of the pipeline results in the repository being cloned, a Docker image being built and tagged, and the image being pushed to Docker Hub.

Uploaded by

SATHEESH K
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

devops_ass2

This document outlines the steps to set up a CI/CD pipeline using Jenkins for automating the building, testing, and deployment of a containerized web application. It includes instructions for installing Jenkins, creating a pipeline job, configuring a GitHub repository, writing a Jenkinsfile, adding Docker credentials, and triggering the pipeline. Successful execution of the pipeline results in the repository being cloned, a Docker image being built and tagged, and the image being pushed to Docker Hub.

Uploaded by

SATHEESH K
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

ASSIGNMENT 2

CI/CD Pipeline Setup Using Jenkins


In this assignment, we will set up a Continuous Integration and Continuous Deployment (CI/CD)
pipeline using Jenkins. This pipeline will automate the process of building, testing, and deploying a
containerized web application.
We will use:
Jenkins – For automation
GitHub – For managing source code
Docker – For containerization
Docker Hub (or another registry) – For storing container images

Steps to Set Up the CI/CD Pipeline


Step 1: Install Jenkins
1. Download and install Jenkins from the official website.
2. Start Jenkins and complete the setup by installing the recommended plugins.
3. Make sure you install the Git and Docker plugins to integrate with these tools.

Step 2: Create a New Pipeline Job


1. Open Jenkins Dashboard and click on "New Item".
2. Select "Pipeline" as the job type and give it a name.
3. Click OK and configure the pipeline settings.

Step 3: Configure the GitHub Repository


1. In the Jenkins job settings, go to Source Code Management.
2. Select Git and enter the GitHub repository URL.
3. If the repository is private, add your GitHub credentials.
4. Set up webhooks in GitHub to trigger the pipeline automatically when changes are made.

Step 4: Write the Pipeline Script (Jenkinsfile)


The pipeline script defines the stages for automation.
Clones the GitHub repository
Builds a Docker image for the application
Pushes the image to Docker Hub
Step 5: Add Docker Credentials (If needed)
1. In Jenkins, go to Manage Jenkins → Credentials.
2. Add a new Docker Hub API Key or login credentials.
3. Use this credential in the Jenkins file for authentication.

Step 6: Trigger the Pipeline


 Manually: Click "Build Now" in Jenkins.
 Automatically: Set up GitHub Webhooks so Jenkins runs the pipeline when new code is
pushed.

Output
When the pipeline runs successfully, you should see:
✅ Repository cloned from GitHub
✅ Docker image built and tagged
✅ Docker image pushed to Docker Hub

You might also like