Task-01
1)Fork this repository.
2)Create a connection to your Jenkins job and your GitHub Repository via GitHub Integration.
Generate the SSH keys for integrating your Jenkins project with your git repository. Use the ssh-keygen command to create public and private key.
Configuring GitHub:
1)Go to your GitHub account settings.
Thus with above command you will get Public key and add this public key in “Key” Section of “SSH & GPG Keys”
For GitHub-Webhook:
Webhooks provide a way for notifications to be delivered to an external web server whenever certain actions occur on a repository or organization.
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 the 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
4)Select the “Git” and provide the below credentials
Click on ADD and for the “kind” label select from the drop down list for
5)Add private key which we created using ssh-keygen command.
Provide Unique ID, Description and then paste the “Private key “ at last as “Paraphrase” and click on ADD
6)Click on the ‘Build Triggers’ tab and then on the ‘GitHub hook trigger for GITScm polling’.
Once the connection between the Jenkins server and Github is successful a green tick as highlighted below will be shown.
Task-02
1)In the Execute shell run the application using Docker compose
2)You will have to make a Docker Compose file for this Project
3)After the build you can check the console output.
Now browse the URL with your public IP address with 8000 port. Before that allow 8000 ports in security groups.