Trigger from external resource

#1

It looks like the only way to trigger a build currently is via a push to the repo that the .drone.yml file exists in. I have a use case where I’m building a docker container for a piece of software that is not my own and would like the pipeline trigger to run when that specific git repo either gets a commit to a branch or a release is tagged. Is this possible?

0 Likes

#2

Hi Alex,

The best way to achieve this today is to ensure the system has at least one build for the target branch (e.g. master). You can then get the latest build by branch, and re-launch the existing build with a new build number.

Get the latest Build / Build Number by Branch:
GET /api/repos/:namespace/:name/builds/:latest?ref=refs/heads/master

Restart the Build with a new Entry:
POST /api/repos/:namespace/:name/builds/:number

We are working on a new endpoint to launch a build from scratch for a specific branch or branch+commit sha. This probably will not land until mid-may, since we are still trying to finalize the API design.

Hope this helps!

0 Likes