Trigger vs pipeline?

What’s the difference between:

POST /projects/:id/trigger/pipeline

and

POST /projects/:id/pipeline

1 Like

Hi @agapanthusblue
with POST /projects/:id/pipeline standalone pipeline is launched with source api.
with POST /projects/:id/trigger/pipeline pipeline is launched with source trigger and such pipeline is shown as child pipeline in pipeline graph. This is the original way how it is possible to launch multi-project child pipelines. Later the trigger: keyword in .gitlab-ci.yml was created which has the same functionality.

EDIT: and some docs regarding triggers

1 Like

This doesn’t appear to be true for me.

Trigger:

keyword does, but the api call does not.

The only difference that I can determine is that trigger/pipeline allows for variables to be set while the other does not.

I honestly cannot understand what “triggers” are about. That entire section of the manual seems to be completely opaque. I don’t even understand the terminology. Is the trigger the entry in the settings section? Or the calling code with the “trigger:” section? Or the called code?

It does show for me when using trigger API call with CI_JOB_TOKEN from .gitlab-ci.yml:

obrázok

Here is the job definition:

trigger_itself:
    script:
        - curl -v --request POST --form "token=$CI_JOB_TOKEN" --form ref=master --form 'variables[SOMEVAR]="ccc"' "https://gitlab.com/api/v4/projects/xxx/trigger/pipeline"

Following this issue and this comment there, I can pass variables to /projects/:id/pipeline.

I use the /projects/:id/trigger/pipeline API for cases where I need to give permission to start pipeline, but nothing else. I haven’t tried to use the trigger token for /projects/:id/pipeline, but I would assume it won’t work.
So if you have access to project anyway, it doesn’t matter. If some for example external app needs to be able to trigger a pipeline BUT nothing else /projects/:id/trigger/pipeline makes sense for me.

1 Like

I couldn’t make that work in our local 12.10 installation. Perhaps it has changed or perhaps ours is naively installed. Or perhaps I’m still stumbling around largely naively.