diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-24 18:10:27 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-24 18:10:27 +0300 |
commit | 474d90a88dfd96f135655d07e9530da3cde6fd64 (patch) | |
tree | b45520d4786bbce5ee6e8ee0c841e8b27c9d0909 /doc/ci/triggers | |
parent | 1f5ca81aa6e674089c9652484e5f3bb89f86703c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/ci/triggers')
-rw-r--r-- | doc/ci/triggers/README.md | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/doc/ci/triggers/README.md b/doc/ci/triggers/README.md index 434adb0c8f3..cec4429629f 100644 --- a/doc/ci/triggers/README.md +++ b/doc/ci/triggers/README.md @@ -140,21 +140,21 @@ By using cURL you can trigger a pipeline rerun with minimal effort, for example: ```shell curl --request POST \ --form token=TOKEN \ - --form ref=master \ + --form ref=main \ "https://gitlab.example.com/api/v4/projects/9/trigger/pipeline" ``` -In this case, the pipeline for the project with ID `9` runs on the `master` branch. +In this case, the pipeline for the project with ID `9` runs on the `main` branch. Alternatively, you can pass the `token` and `ref` arguments in the query string: ```shell curl --request POST \ - "https://gitlab.example.com/api/v4/projects/9/trigger/pipeline?token=TOKEN&ref=master" + "https://gitlab.example.com/api/v4/projects/9/trigger/pipeline?token=TOKEN&ref=main" ``` You can also benefit by using triggers in your `.gitlab-ci.yml`. Let's say that -you have two projects, A and B, and you want to trigger a pipeline on the `master` +you have two projects, A and B, and you want to trigger a pipeline on the `main` branch of project B whenever a tag on project A is created. This is the job you need to add in project A's `.gitlab-ci.yml`: @@ -162,7 +162,7 @@ need to add in project A's `.gitlab-ci.yml`: trigger_pipeline: stage: deploy script: - - 'curl --request POST --form token=TOKEN --form ref=master "https://gitlab.example.com/api/v4/projects/9/trigger/pipeline"' + - 'curl --request POST --form token=TOKEN --form ref=main "https://gitlab.example.com/api/v4/projects/9/trigger/pipeline"' only: - tags ``` @@ -261,11 +261,11 @@ of all types of variables. ## Using cron to trigger nightly pipelines Whether you craft a script or just run cURL directly, you can trigger jobs -in conjunction with cron. The example below triggers a job on the `master` +in conjunction with cron. The example below triggers a job on the `main` branch branch of project with ID `9` every night at `00:30`: ```shell -30 0 * * * curl --request POST --form token=TOKEN --form ref=master "https://gitlab.example.com/api/v4/projects/9/trigger/pipeline" +30 0 * * * curl --request POST --form token=TOKEN --form ref=main "https://gitlab.example.com/api/v4/projects/9/trigger/pipeline" ``` This behavior can also be achieved through the GitLab UI with |