Drone does not gets triggered via Github deployment event

Hi,

I am trying to trigger Drone pipeline only on deployment event dispatched from GIthub and before jump on, let me give you context about this poc.

Context of this requirement

  1. Using jenkins for building the artifact
  2. Drone to do the deployment only, as drone has required permissions to do the deployment

So to accomplish this i am trying use the deployment event only to trigger the drone pipeline, below is the follow of approach:

  1. Jenkins do all activities till uploading the artifact to centralized location
  2. then at last jenkins will create github deployment for our repo using API call
  3. This github deployment will dispatch the deployment event on to drone webhook
  4. Drone webhook configuration will be updated to only listen for deployment event
  5. Drone pipeline gets executed on these deployment events.

What i have done so far in same:

  1. Able to create githhub deployments using curl command calling github API.
  2. Above command gets executed successfully as i can see the the whole deployment event payload on console.
  3. To cross check that further i can see new entry in Github webhook Recent Deliveries for deployment event which is dispatched with GREEN in status and 204 response code.
  4. At Drone site i have defined on pipeline step with when condition like environment: dev and event: deployment, but unfortunately drone pipeline does not gets triggered

Can someone help in this, i mean if this possible in above way, if yes mistake am doing and this approach is not feasible please suggest the alternate approach, i know about one where we can directly use the drone cli to trigger the deployment, but i want to if anything else can be done to achieve this use case.

Let me know if any other information is required from my side.

thx,
Sandeep

Drone does not gets triggered via Github deployment event

Drone is configured to automatically receive deployment hooks from GitHub, however, Drone will ignore these hooks unless you have deployment events enabled for your repository in the Drone user interface.

Thanks for updating me on this, after updating repository settings at Drone side, this works like charm!!!

Please update me on below queries as well:

  • as i can see that only push/pull request/tag/deployment options are available this means that Drone only accept request for only these events? or it will accept for other events as well which are available on Github webhook configuration side?
  • Can i use the payload information in the .drone.yml with respect to below items
    • Inside when condition - i know we can use the environment/branch etc… can we use any other key/value as well, if yes please share some info
    • can we define environment variables using payload which will be used by stages/steps in pipeline, if yes please share some info
    • how can i pass payload information to any stage/step which gets executed inside container using some docker image.

Thx,
Sandeep

as i can see that only push/pull request/tag/deployment options are available this means that Drone only accept request for only these events? or it will accept for other events as well which are available on Github webhook configuration side?

Supporting addition events is planned. You can star this github issue for updates: https://github.com/drone/drone/issues/1878

Can i use the payload information in the .drone.yml with respect to below items […]

Drone does not currently store the deployment payload field.

Thanks for updating me.