Day 24 : Complete Jenkins CI/CD Project

Day 24 : Complete Jenkins CI/CD 
                                    Project

Let's build a bang CICD pipeline for your nodejs application

First fork This repository:

How are you going to connect your GitHub repository and Jenkins task now?

Yes, via GitHub integration. Following are the step:-

Steps:

  • Create the SSH keys needed to link your git repository and Jenkins project. SSH-keygen can be used to generate both public and private keys.

    2.png

Configuring GitHub

1.Go to your GitHub account settings.

2. Go to SSH and GPG keys, Add public key that we created using ssh-keygen and select key-type Authentication key.

git 3.png

For GitHub-Webhook:

1.Go to your GitHub repository and click on Settings.

2.Click on Webhooks and then click on Add webhook.

3. In the ‘Payload URL’ field, paste your Jenkins environment URL. At the end of this URL add /github-webhook/. In the ‘Content type’ select: ‘application/json’ and leave the ‘Secret’ field empty.

3.png

For Installing GitHub Integration plugin in Jenkins

  1. Open your jenkins dashboard.

  2. Click on the Manage Jenkins button on your Jenkins dashboard

  3. Click on Manage Plugins

  4. Install GitHub Integration plugin

    4.png

Configuring Jenkins:

1. Create a jenkins job

zh.png

2 . Create node-todo-app freestyle project

3. In Configure, GitHub project URL write your project GitHub URL

6.png

  1. In Git, add credentials for Jenkins

    7.png

5. Add private key which we created using ssh-keygen command

9.png

6. Click on the ‘Build Triggers’ tab and then on the ‘GitHub hook trigger for GITScm polling.

10.png

Task 2:

In the Execute shell run the application using Docker compose

11.png

You will have to make a Docker Compose file for this Project

4323.png

After build you can check console output.

Using docker ps command, you can see container is created.

Browse public IP address with port no.8000

14.png