Day 24/25 Task: Complete Jenkins CI/CD Project

Day 24/25 Task: Complete Jenkins CI/CD Project

Task-01

  • Fork this repository:

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

  • GitHub WebHooks.

A Webhook, also known as a Web Callback or HTTP push API is a mechanism for an application to provide real-time data to other apps. A Webhook sends data to other applications in real-time, so you get it right away. Unlike traditional APIs, you won’t have to poll for data very often to receive real-time results. Webhooks become significantly more efficient for both the provider and the consumer as a result of this. The sole disadvantage of Webhooks is the complexity in putting them up at first.

When specified actions on a repository or organization occur, a GitHub Webhook allows notifications to be sent to an external web server. Webhooks can be triggered anytime a repository or an organization performs a range of actions. You can, for example, set up a Webhook to fire whenever:

  • A repository is created and pushed to.

  • A pull request has been opened.

  • A GitHub Pages site is created.

  • A team gets a new member.

GitHub Webhooks allow you to create or set up integrations on GitHub.com, such as GitHub Apps or OAuth Apps, that subscribe to specific events. They will send an HTTP POST payload to the Webhook’s defined URL when one of those events occurs. Webhooks can be placed on a GitHub App, an organization, or a specific repository. The Webhook will be dispatched each time one or more subscribed events occur once it is installed

forked the repo.

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

Step1:Create 2 servers

Step2:Connect Master and Agent through SSH-KEYGEN(SSH KEY PUBLIC KEY)

Step3:Integrate Jenkins with Github through webhook

Step4:Create Node over Jenkins--Manage jenkins--new node.

Step5:Create credentials add Master private key under SSH key while creating credentials.

Step6:

Connect to the Master by using private key.

1st generate key-SSH-KEYGEN in terminal.

then goto cd .ssh/-->ls-->take rsa_pub key from Master server go to agent server-add it to authorized file-->come back to master server and make sure if both are connected or not -->ssh ubuntu@ip of agent.

Once above step completed go to Jenkins and create credentials take private key from master and put it under SSH key so that Master will get sync with Jenkins and add Host IP as well while creating key.

Step7:Add public key in Agent server to connect.

Add id_rsa key under SSH key while creating credentials in jenkins.

Step8:Verify the status of Nodes if it is Sync or not.

Step9:For Jenkins-Github intergration:(Webhook),so that any changes/commits it should pick automatically.(CI/CD)

Task-02

  • 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:)

  • Requirments.txt

  • Freestyle project

Freestyle Project:

Project Description:

Build Step:

Open port under security group and verify Public IP.

Here is the output..!!

Thank you for reading!! Hope you find this helpful.

#day24/25#90daysofdevops#devopscommunity#

Always open for suggestions..!!