i am coming from ConcourseCi and wonder if there is a possibility to implement your own pipeline trigger in drone.
We have a rather complex CI/CD Pipeline construct where pipelines are not only triggered when a new commit or PR on a repo arrives. E.g. we have a pipeline that is triggered when new files are uploaded to a s3 bucket …
The easiest way to achieve this today would be to create a small utility that masquerades as GitHub and sends webhooks to Drone using the GitHub format / payload. Drone does not really care where the webhook is coming from, as long as the webhook token matches, and the content and headers are in the expected format.
For example, if you go to your repository settings in GitHub you can see the exact payloads and headers that GitHub sends to Drone. You can use these to reproduce a GitHub webhook via curl, to test out this approach.
In the future we will expose an API call to more easily trigger a build from a custom event source, but in the mean time, this is probably your best option.
Is it possible to pass any additional data this way? Are any of the build environment variables taken from the GitHub hook, or are they taken from the checked out Git repo?
EDIT: with the API it seems https://docs.drone.io/api/builds/build_create/
Does this mean this issue is partly resolved? I assume API access means more permissions than merely webhooks.
Yes this issue is resolved. You can use the Build Create endpoint to launch a build with custom parameters (see the examples). Builds created with this endpoint have the
custom event type. The API endpoint requires write access to the repository.