-
Notifications
You must be signed in to change notification settings - Fork 1
Webhooks
First install Github pull request builder plugin and it's depedencies in Jenkins using the plugin manager. The plugin's github page provides a step-by-step guide on how to add the Github integration to the project.
Setting the build status can be set by using the following script as a task in job configuration after building the project:
if [[ $BUILD_STATUS == "success" ]]
then
export STATUS="success"
else
export STATUS="failure"
fi
curl "https://api.github.com/repos/username/my_repo/statuses/$GIT_COMMIT?access_token=abc123" \
-H "Content-Type: application/json" \
-X POST \
-d "{\"state\": \"$STATUS\", \"description\": \"Jenkins\", \"target_url\": \"http://my.jenkins.box.com/job/dividata/$BUILD_NUMBER/console\"}"Where you need to replace the url with url of your repository and replace the Personal access token. It’s recommended to create a separate Github user for Jenkins, which will need push rights for the repository.
For the Github pull request plugin to work, a webhook is needed. Because our Jenkins was running on localhost, we set up ngrok to test the pull request. Ngrok is a forwarding service, which can be used to bind local addresses to a public address. Ngrok can be run with the following command in terminal.
./ngrok http 8080Ngrok will give a forwarding address, which then can be used for the webhook in the Jenkins. It can be set in Manage Jenkins → GitHub Pull Request Builder → Jenkins URL override.

- IDE Setup
- Github
- Jenkins Installation
- Tests
- UI testing in Android Studio
- Unit testing in XCode
- Instrument testing in Android Studio
- Instrument testing in XCode
- Integrating test reports into Jenkins
- GitHub Radiator
- Build Radiator
- Test Radiator