Is there a way to configure a CI/CD pipeline which does not require the use of a .gitlab-ci.yml file in the repo’s root?
Ideally, I am thinking of an API to add/configure/delete a pipeline
Is there a way to configure a CI/CD pipeline which does not require the use of a .gitlab-ci.yml file in the repo’s root?
Ideally, I am thinking of an API to add/configure/delete a pipeline
Hi @imaman
You can use the below API for Pipeline configuration using curl request.
Create a new pipeline
----------------------
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/pipeline?ref=master"
Delete a pipeline
----------------------
curl --header "PRIVATE-TOKEN: <your_access_token>" --request "DELETE" "https://gitlab.example.com/api/v4/projects/1/pipelines/46"
List project pipelines
-----------------------
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/pipelines"
May this will help to resolve your issue.
Thanks,
Kiran
Thanks, @kirangavali, this is useful. However, I meant for something slightly different: is it possible to define the configuration (i.e., define the stages, define jobs and assign them to stages, etc.) from API. In other words: is there an API that can be used instead of .gitlab-ci.yml
?