Complete Jenkins CI/CD Project

Complete Jenkins CI/CD Project

Let Set Up the Jenkins CI/CD Project

For this follow these step carefully and here we begins

Step 1: Fork the Repository

First, you need to fork the repository. This will create a copy of the project under your GitHub account, allowing you to make changes without affecting the original project.

  1. Go to the repository URL.
  2. Click on the "Fork" button in the upper right corner.
  3. Select your GitHub account to fork the repository.

Step 2: GitHub Integration with Jenkins

Next, set up a connection between your Jenkins job and your GitHub repository.

  1. Open Jenkins Dashboard.
  2. Create a New Item: Enter a name for your job and select "Freestyle project
  3. Configure GitHub Project:



  1. Source Code Management:


Click-on Build now



Task 2: Running the Application with Docker Compose

Create a Docker Compose File

Docker Compose simplifies running multi-container Docker applications. Create a docker-compose.yml file in your project root:


version: '3'
services:
  app:
    image: node:14
    working_dir: /app
    volumes:
      - .:/app
    command: sh -c "npm install && npm start"
    ports:
      - "3000:3000"
        

Step 2: Configure Jenkins Job

  1. Open Jenkins Job Configuration.
  2. Build Triggers: Ensure "GitHub hook trigger for GITScm polling" is checked.
  3. Build Environment: Check "Provide Node & npm bin/ folder to PATH".
  4. Build Steps: Execute Shell: docker-compose up -d

Step 3: Run the Project

  1. Save your Jenkins job configuration.
  2. Click "Build Now" to trigger the build manually or push a change to your GitHub repository to trigger automatically via WebHooks.

What is WebHooks?

Webhooks are automated messages sent from one application to another when a specific event occurs. They are a way for web services to communicate with each other in real-time, without the need for constant polling. Essentially, a webhook allows an application to automatically send data to another application as soon as a particular event happens.

Continuous Integration/Continuous Deployment (CI/CD):

  • In CI/CD pipelines, webhooks can be used to trigger builds or deployments whenever new code is pushed to a repository (e.g., GitHub, GitLab).
  • For example, when a developer pushes code to GitHub, a webhook can trigger Jenkins to start a new build process.



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

Riya Negi的更多文章

  • Kubernetes Overview

    Kubernetes Overview

    What is Kubernetes and Why Do We Call It K8s? Kubernetes (often abbreviated as K8s) is an open-source platform for…

    1 条评论
  • Jenkins Important Interview Questions

    Jenkins Important Interview Questions

    Important Interview Questions. Jenkins is a cornerstone of modern CI/CD pipelines, and mastering it can give you a…

  • Mastering Jenkins Agents!

    Mastering Jenkins Agents!

    The Jenkins Master, often referred to as the Jenkins Server, is the core component in a Jenkins architecture. It…

  • Jenkins Declarative Pipeline with Docker

    Jenkins Declarative Pipeline with Docker

    Hello Connections, So we will start with Jenkin Declarative pipeline with Docker. Before that we should know why to…

    2 条评论
  • Jenkins Declarative Pipeline

    Jenkins Declarative Pipeline

    So, Lets go deep into Jenkins and learn to start Pipeline in Jenkins. First let basics of Pipeline and all stuffs.

  • Jenkins Freestyle Project for DevOps Engineers.

    Jenkins Freestyle Project for DevOps Engineers.

    What is CI/CD? CI/CD stands for Continuous Integration (CI) and Continuous Deployment (CD) (or Continuous Delivery). It…

  • Getting Started with Jenkins

    Getting Started with Jenkins

    What is Jenkins? Jenkins is an open-source continuous integration (CI) and continuous delivery/deployment (CD)…

  • Docker Important interview Questions.

    Docker Important interview Questions.

    1. What is the difference between an Image, Container, and Engine? Image: An image is a lightweight, stand-alone…

  • Docker Cheat Sheet

    Docker Cheat Sheet

    Docker is a powerful tool for containerization that enables developers to package applications along with their…

  • Docker Project for DevOps Engineers

    Docker Project for DevOps Engineers

    Lets build the first ngnix container and see it is working or not? So we will give command as -docker run -d -p 80:80…

社区洞察

其他会员也浏览了