Day 24 Task: Complete Jenkins CI/CD Project

Day 24 Task: Complete Jenkins CI/CD Project

Task-01

- Fork the repository

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

- Read About [GitHub WebHooks] and make sure you have CICD setup.

Step:2 Create a connection to our Jenkins job and our GitHub Repository via GitHub Integration.

Step3:

Adding Jenkins Webhook in Github

  1. Open Github repository.

  2. Go to “settings” and then to “hooks”.

  3. Click the “Add webhook” button

Task-02

In the Execute shell run the application using Docker compose

pipeline {
    agent any

    stages{
        stage('Code'){
            steps {
                git url: 'https://github.com/Akanksha2619/node-todo-cicd.git', branch: 'master'
            }
        }
        stage('Build and Test'){
            steps {
                sh 'docker build . -t node-todo-app-cicd:latest' 
            }
        }
       stage('Deploy'){
            steps {
                sh 'docker-compose down && docker-compose up -d'
            }
        }
       stage('Successfully Deployed'){
            steps {
                echo "node-to-do app has been successfully deployed"
            }
        }   
    }
}

Thank you for reading.