Reputation: 11768
I have a gitlab
repo MAIN
, where I run a pipline.
I have another gitlab
repo SUB
. where I run another pipeline
Now I want to trigger the pipline in MAIN
repo from the SUB
i.e whenever i commit any change in SUB
it should trigger the pipeline in MAIN
How do I do that in the gitlab-ci.yml
file of the SUB
Upvotes: 3
Views: 1994
Reputation: 5551
You can use Pipelines API, for example :
curl --request POST \
--form token=TOKEN \
--form ref=main \
"https://gitlab.example.com/api/v4/projects/9/trigger/pipeline"
You need an Authentication token
Upvotes: 0
Reputation: 67047
You want Pipeline Triggers:
MAIN
, you add a new triggerSUB
, you trigger the pipeline in MAIN
Upvotes: 1