Day 24 Task: Complete Jenkins CI/CD Project
Let's make a beautiful CI/CD Pipeline for your Node JS Application?
Task-01
Fork?this?repository:
Create a connection to your Jenkins job and your GitHub Repository via GitHub Integration.
Steps:
Generate the SSH keys for integrating your Jenkins project with your git repository. Use ssh-keygen command to create public and private key.
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.
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.
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
Configuring Jenkins:
1. Create a jenkins job
2. Create node-todo-app freestyle project
3. In Configure, GitHub project URL write your project GitHub URL
4.In Git, add credentials for jenkins
5. Add private key which we created using ssh-keygen command.
6. Click on the?‘Build Triggers’?tab and then on the?‘GitHub hook trigger for GITScm polling’.
Task 2:
In the Execute shell run the application using Docker compose
You will have to make a Docker Compose file for this Project
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
Happy Learning :)