Hello Guys,
In recent days one of my friend had ask me is it possible that when ever some one raise a pull request in the github repo.
ex. Assume i have github repo called newrepo. Now whenever some one push his code into my repo I need to validate that code against some bench mark of quality and i also need to make sure that the code is of good quality and If it has any defect then I should get those in github comment on the pull request.
Its has to be done in steps
In recent days one of my friend had ask me is it possible that when ever some one raise a pull request in the github repo.
ex. Assume i have github repo called newrepo. Now whenever some one push his code into my repo I need to validate that code against some bench mark of quality and i also need to make sure that the code is of good quality and If it has any defect then I should get those in github comment on the pull request.
Its has to be done in steps
- Create a Github webhooks
- Generate personal access token with appropriate permissions .
- Create a jenkins Job
- setup of Sonarqube
- Step up Quality gate for the Project (Optional)
In My case go to URL https://github.com/navneet-rathi/newrepo
Open your repository in that click on settings and in settings click on Webhooks or goto URL.
https://github.com/navneet-rathi/newrepo/settings/hooks.
Replace newrepo with the name of your project repository.
click on add a Webhook and fill the details of your Jenkins server as shown in the picture.
This web-hook will send an information about the Pull request and to trigger a jenkins job we need to create one more web hook as shown in below screenshot
and Thats It We are done with part 1
.
In next part I will setup jenkins and remaining configuration and sonar changes
https://github.com/navneet-rathi/newrepo/settings/hooks.
Replace newrepo with the name of your project repository.
click on add a Webhook and fill the details of your Jenkins server as shown in the picture.
This web-hook will send an information about the Pull request and to trigger a jenkins job we need to create one more web hook as shown in below screenshot
and Thats It We are done with part 1
.
In next part I will setup jenkins and remaining configuration and sonar changes
No comments:
Post a Comment