Day 25 - Complete Jenkins CI/CD Project - Continued with Documentation

Day 25 - Complete Jenkins CI/CD Project - Continued with Documentation

Continuous Integration (CI) and Continuous Deployment (CD) are crucial components of modern software development, ensuring rapid and reliable delivery of applications. In this guide, we will walk through the steps to set up an automated CI/CD pipeline for a Node.js application using AWS EC2, Docker, GitHub, and Jenkins.

Getting Started

To begin, make sure you have the following prerequisites in place:

  • AWS EC2 instance
  • Jenkins installed
  • Docker and Docker-compose installed
  • GitHub account
  • GitHub integration plugin installed in Jenkins


Installation

  1. Launch EC2 Instance: Launch an AWS EC2 instance and ensure that you have the necessary permissions.
  2. Install Jenkins, Docker, and Docker-compose: Follow the provided links for instructions on installing Jenkins, Docker, and Docker-compose.
  3. Fork and Clone Repository: Clone the repository onto your EC2 instance using the following commands git clone
  4. Create SSH Keys: Generate SSH public and private keys on your EC2 instance:ssh-keygen cd .ssh cat id_rsa cat id_rsa.pub
  5. Configuring GitHub:In GitHub, go to Account Settings, click on SSH and GPG keys, and add the public IP of your EC2 instance.Configure GitHub Webhook: In your repository settings, click on Webhooks, add a webhook with the Jenkins environment URL, and set the payload URL to https://your-jenkins-ip/github-webhook/.
  6. Configuring Jenkins:Install the GitHub integration plugin in Jenkins.Create a freestyle project, configure the GitHub project URL, and set up the Git repository credentials.
  7. Jenkins CI/CD Pipeline Steps:Configure the build trigger to use GitHub hook trigger for GITScm polling.Set up build steps using Docker-compose commands to build and deploy the Node.js application.Example Build Steps:echo "starting container" docker-compose down docker-compose up -d --no-deps --build <service_name>
  8. Check Webhook Connection: Verify the webhook connection by checking for a green checkmark in the GitHub project.
  9. Run the Pipeline: Go to the Jenkins dashboard, click on the project, and build the project to trigger the CI/CD pipeline.
  10. Access Application: Access the application at https://public_ip_of_instance:8000 in a web browser.


Usage

After completing the setup, any changes pushed to the GitHub main branch will trigger the Jenkins pipeline automatically. Monitor the Jenkins dashboard for build statuses and access the deployed application to verify the changes.

Contributing

Contributions to this project are welcome. If you have any suggestions, enhancements, or bug fixes, follow these steps:

  1. Fork the project.
  2. Create a new branch for your feature (e.g., git checkout -b feature/AmazingFeature).
  3. Commit your changes (git commit -m 'Add some AmazingFeature').
  4. Push to the branch (git push origin feature/AmazingFeature).
  5. Open a Pull Request.



Your contributions are highly appreciated in making this CI/CD pipeline more robust and efficient.

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

Muhammad Shaheryar的更多文章

  • Day 30 - Terraform

    Day 30 - Terraform

    Introduction Terraform is a powerful open-source tool that falls under the category of Infrastructure as Code (IaC). It…

  • Day 29 - Jenkins Important interview Questions

    Day 29 - Jenkins Important interview Questions

    Mastering Jenkins for Docker-Centric CI/CD: A Comprehensive Interview Guide In the ever-evolving landscape of DevOps…

  • Day 28 - Jenkins Agents

    Day 28 - Jenkins Agents

    Introduction Jenkins, an open-source automation server, plays a crucial role in orchestrating workflows through…

  • Day 27 - Jenkins Declarative Pipeline with Docker

    Day 27 - Jenkins Declarative Pipeline with Docker

    Welcome back to our Jenkins journey! We've already mastered the basics of Declarative Pipelines in Jenkins. Now, let's…

  • Day 26 - Jenkins Declarative Pipeline

    Day 26 - Jenkins Declarative Pipeline

    Introduction In the realm of DevOps and Continuous Integration/Continuous Deployment (CICD), Jenkins plays a pivotal…

    3 条评论
  • Day 24 - Complete Jenkins CI/CD Project

    Day 24 - Complete Jenkins CI/CD Project

    Introduction Welcome to this comprehensive guide on setting up a Jenkins CI/CD pipeline for deploying a Node.js To-Do…

  • Day 23 Task: Jenkins Freestyle Project for DevOps Engineers.

    Day 23 Task: Jenkins Freestyle Project for DevOps Engineers.

    Introduction In the dynamic realm of software development, Continuous Integration (CI) and Continuous Delivery (CD)…

  • Day 22 - Getting Started with Jenkins

    Day 22 - Getting Started with Jenkins

    Understanding Jenkins: At its core, Jenkins is an open-source automation server, a DevOps tool crafted in the Java…

  • Day 21 - Docker Important Interview Questions

    Day 21 - Docker Important Interview Questions

    Introduction In the dynamic landscape of DevOps engineering, Docker has emerged as a cornerstone technology. Docker…

  • Day 20 - Docker Cheat Sheet

    Day 20 - Docker Cheat Sheet

    Docker is a powerful platform that enables developers to create, deploy, and run applications in containers. Whether…

社区洞察

其他会员也浏览了