QuickBuild integrates with Azure Devops via the Azure repository. This repository has all features of a normal Git repository, but add the ability to build against pull requests, and update the status based on build result for commits or pull requests.
Build against Pull Requests
If you want to build against pull request, username field and password field are required. The password can also use a personal access token instead. To generate personal access token, please see this page.
If the personal access token is used, the token should at least include code read scope.
You can filter the pull requests by adding the parameters you want:
Now, QuickBuild can build against the pull request branch refs/pull/*/merge.
Azure Devops Webhook
QuickBuild can trigger build via Azure Devops web hooks.
Configure QuickBuild Side
Add anonymous group
As the webhook is triggered without authentication, anonymous group should be added and it should have the permission to use RESTful API.
Add webhook settings
To add integration at QuickBuild side, please go to configuration settings page and then choose Webhook -> Azure Devops from right side menu:
Then, you can add the settings:
- Trigger User the user to trigger the build
- Webhook Secret the secret should be the same as what you defined in Azure authorization header
- Trigger Condition the trigger condition in Groovy scripts, when the result is true, build will be triggered, otherwise, the build will not be triggered. You can use variable delivery to access the data from GitHub like delivery.ref, delivery.pusher.name. See more details on https://docs.microsoft.com/en-us/azure/devops/service-hooks/events?view=azure-devops. You can also use the parameter specified in webhook URL as below section.
- Trigger Build Variables define the variables to trigger the builds so you can use those variables in the steps later.
Configure Azure Side
To enable the webhook, first you need go to Azure Devops web hook settings page to configure the QuickBuild side related information:
Important you need add Authorization header if you specify the secret at QuickBuild side. The header looks like below (replace the my-scret-code to your actual secret token):
Authorization: Basic my-secret-code
If you want to use some custom parameters, you can add them to your webhook url like below:
Then, later you can use target parameter in your trigger condition.