DevOps Project -2 ????

DevOps Project -2 ????

Project Description

The project is about automating the deployment process of a web application using Jenkins and its declarative syntax. The pipeline includes stages like building, testing, and deploying to a staging environment. It also includes running acceptance tests and deploying to production if all tests pass.

Steps:

Create an EC2 instance by going to the EC2 console.

No alt text provided for this image

Connect to the EC2 instance using SSH client

No alt text provided for this image

Step 2: Install Jenkins and Docker on the AWS EC2 Ubuntu instance

Install Jenkins and Docker using the instructions in my DevOps Project 1 article:

Link: https://www.dhirubhai.net/posts/vinaykumar04_90daysofdevops-devops-pipeline-activity-7077533672366575616-y0RK?utm_source=share&utm_medium=member_desktop

Install Jenkins:

Jenkins requires the Java Runtime Environment (JRE).

To install OpenJDK 11, run:

sudo apt install openjdk-11-jdk -y        

Follow the below steps to install Jenkins:

curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee 
  /usr/share/keyrings/jenkins-keyring.asc > /dev/null
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
  https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
  /etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update
sudo apt-get install jenkins        

Install Docker:

Install docker using the below command:

sudo apt-get install docker.io        

?Check the version of Jenkins and Docker using the command:

jenkins --version
docker --version        

Check at instance-public-IP:8080. It will launch the Jenkins dashboard.

Navigate to Jenkins Dashboard and click the "New Item" button.

No alt text provided for this image

Give your project a name and choose the "Pipeline" project type.

No alt text provided for this image

Go to the project configuration page

No alt text provided for this image

Now navigate to the pipeline section and pick Pipeline script in the definition.

No alt text provided for this image

Write a pipeline script

No alt text provided for this image

Pipeline: The pipeline block is required at the beginning of the Declarative pipeline.

Agent: The agent specifies where the Jenkins build job should be executed. In this situation, we choose an agent.

Stages: The stages block is made up of many executable stage blocks.

Within the stages block, at least one stage block is required.

This pipeline is divided into four stages:

Checkout: This stage downloads the code from GitHub's develop branch.

Build: During this stage, a Docker image for the Django application is created.

This step performs unit tests on the Django application.

Deploy: The Docker container for the Django application is deployed during this stage.

Steps: Steps blocks contain the actual operation that must be executed within Jenkins.

Create the project. You can build the project manually by clicking the "Build Now" option on the project's home page.

The build is successfully completed.

After a build is completed, you can view the console output by clicking on the “Console Output” link on the build page.

No alt text provided for this image

Each stage view can be viewed by clicking on the "Full Stage View" button on the project's home page.

No alt text provided for this image

Docker image and container is created using the Jenkins pipeline

No alt text provided for this image

Browse public IP address with port no.8000

No alt text provided for this image

ThankYou ??

要查看或添加评论,请登录

Vinay Kumar的更多文章

  • DevOps Project - 4 ????

    DevOps Project - 4 ????

    Project Description The project aims to deploy a web application using Docker Swarm, a container orchestration tool…

    7 条评论
  • DevOps Project 3 ????

    DevOps Project 3 ????

    Project Description The project involves hosting a static website using an AWS S3 bucket. Amazon S3 is an object…

    3 条评论
  • Day 80: DevOps Project 1 ????

    Day 80: DevOps Project 1 ????

    Project Description The project aims to automate the building, testing, and deployment process of a web application…

    2 条评论
  • Day 73 - Setup Grafana on AWS EC2 Instance ????

    Day 73 - Setup Grafana on AWS EC2 Instance ????

    Task: Set up grafana in your local environment on AWS EC2. Go to the AWS console and Launch an EC2 instance To enable…

  • Day 72 - Grafana ????

    Day 72 - Grafana ????

    What is Grafana? No matter where your metrics are kept, Grafana is an open-source data visualization and monitoring…

    4 条评论
  • Day71 - Terraform Interview Questions ????

    Day71 - Terraform Interview Questions ????

    1. What is Terraform and how it is different from other IaaC tools? HashiCorp's Terraform is an Infrastructure as Code…

  • Day 70 - Terraform Modules ????

    Day 70 - Terraform Modules ????

    Modules are containers for multiple resources that are used together. A module consists of a collection of .

    4 条评论
  • Day 69 - Meta-Arguments in Terraform ???

    Day 69 - Meta-Arguments in Terraform ???

    When you define a resource block in Terraform, by default, this specifies one resource that will be created. To manage…

    4 条评论
  • Day 65 - Terraform Resources ????

    Day 65 - Terraform Resources ????

    Understanding Terraform Resources A resource in Terraform represents a component of your infrastructure, such as a…

    2 条评论

社区洞察

其他会员也浏览了