👻Day 29 Task: Complete Jenkins CI/CD Project

👻Day 29 Task: Complete Jenkins CI/CD Project

·

4 min read

👻Day 29 Task: Complete Jenkins CI/CD Project

✅Table of Content

✅Introduction

✅Day-28 Recap: Jenkins CI/CD.

✅Tasks:

✅Task-1:

  • Fork the repository:

  • Create a connection to your Jenkins job and your GitHub Repository via GitHub Integration.

  • GitHub Web Hooks and make sure you have CICD setup

✅Task-2:

  • In the Execute shell run the application using Docker compose

  • You will have to make a Docker Compose file for this Project (Can be a good open source contribution)

  • Run the project and give yourself a treat:)

✅Introduction:

Hello passionate DevOps engineers! In today's blog, we're diving into an exciting project focused on Jenkins and Docker Compose—two essential tools for automating and streamlining your development and deployment processes. This hands-on task will help you set up a Continuous Integration/Continuous Deployment (CI/CD) pipeline and run your application in Docker containers.

✅Day-28 Recap: Jenkins CI/CD.

Before delving into the project, let's review the principles explored in Day 28. Jenkins stands as a popular open-source automation server facilitating CI/CD workflows. It empowers developers to automate diverse phases of the software development cycle, encompassing building, testing, and deploying applications. Core topics encompass:

  • Installation of Jenkins on a server.

  • Establishment of Jenkins jobs for task automation.

  • Integration of Jenkins with GitHub for version control.

  • Configuration of webhooks to initiate Jenkins builds in response to code alterations.

✅Tasks:

✅Task-1:

  • Fork the repository:

  • Create a connection to your Jenkins job and your GitHub Repository via GitHub Integration.

  • GitHub Web Hooks and make sure you have CICD setup

Repo:github.com/LondheShubham153/node-todo-cicd

Step 1: Connect Jenkins to GitHub

  1. Fork the Repository:

  2. Link Jenkins with GitHub:

  3. Set Up GitHub Webhooks:

  4. Verify CI/CD Setup:

Now your Jenkins job is connected to your GitHub repository via GitHub integration, and CI/CD is set up with GitHub Webhooks. You're all set to automate your CI/CD pipeline for the node-todo-cicd project!

✅Task-2:

  • In the Execute shell run the application using Docker compose

  • You will have to make a Docker Compose file for this Project (Can be a good open source contribution)

  • Run the project and give yourself a treat:)

  1. Create a Docker Compose File:

    • Open a text editor and create a new file named docker-compose.yml.

    • Define the services for your app. Here’s a basic example to get you started:

          version: '3.8'
          services:
            app:
              image: node:latest
              ports:
                - "3000:3000"
              volumes:
                - .:/app
              environment:
                - NODE_ENV=development
              command: npm start
      
    • Save the file in the root directory of your project.

  2. Run the Application:

    • Open a terminal and navigate to the directory where your docker-compose.yml file is located.

    • Run the command: docker-compose up -d. This command will start your application in the background.

  3. Verify Everything:

    • Open your web browser and go to localhost:3000 to see if your Node.js application is running properly.

😊Conclusion:

You've successfully set up a CI/CD pipeline with Jenkins and Docker Compose. Your Jenkins job is now connected to GitHub and automatically builds your code, and your application is running smoothly using Docker Compose. Great job and keep up the good work! 🎉🚀

Happy Learning :)😊

Â