Trigger single pipeline in build via API

Hi there :wave:

For context, the problem that I am trying to solve, is having a Drone build that is comprised of several pipelines:

  • Some pipelines are triggered on the regular PR/push to master workflow.
  • Some that I want to trigger via API, with granularity of a specific pipeline.

So far, I was able to put together a Drone config that allows me to differentiate between the regular builds and the API triggered ones, but I was not able to figure out from the documentation if its possible to trigger a specific pipeline (skipping the other ones).

For reference, I am using Drone v1.9.1. This is a sample Drone config:

---
kind: pipeline
type: docker
name: example pipeline

platform:
  os: linux
  arch: amd64

steps:
- name: build event
  image: alpine
  commands:
  - echo $DRONE_BUILD_EVENT

trigger:
  event:
    exclude:
    - custom

---
kind: pipeline
type: docker
name: custom trigger

platform:
  os: linux
  arch: amd64

steps:
- name: build event
  image: alpine
  commands:
  - echo $DRONE_BUILD_EVENT

trigger:
  event:
  - custom

---
kind: pipeline
type: docker
name: api-driven-pipeline-b

platform:
  os: linux
  arch: amd64

steps:
- name: build event
  image: alpine
  commands:
  - echo $DRONE_BUILD_EVENT

- name: inspect envvars
  image: alpine
  commands:
  - echo "CUSTOM_DRONE_ENVVAR=${CUSTOM_DRONE_ENVVAR}"

trigger:
  event:
  - custom
...

Pushing to main:

image

Running drone build create my-org/my-repo:

image

TL;DR: How can I trigger a specific pipeline (in a multiple pipeline build) via the API?

1 Like

:wave: hey there, sorry, this capability is not currently supported.

We (Grafana Labs backend team) also need the capability to trigger specific pipelines via the API.