Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-08-10 09:08:47 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-08-10 09:08:47 +0300
commit0adc81d8e0c7b291fd7fdef33a4ea9c01b4852ce (patch)
treea5ef7b7c4109427b748d239066435151a43fb499 /doc/ci/chatops
parentf2c0afdcb5597b226d75cdb043e57f79034b04bb (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/ci/chatops')
-rw-r--r--doc/ci/chatops/index.md14
1 files changed, 11 insertions, 3 deletions
diff --git a/doc/ci/chatops/index.md b/doc/ci/chatops/index.md
index 03a1005c9bc..a461147661c 100644
--- a/doc/ci/chatops/index.md
+++ b/doc/ci/chatops/index.md
@@ -49,7 +49,7 @@ If a job shouldn't be able to be triggered from chat, you can set the job to `ex
Since ChatOps is built upon GitLab CI/CD, the job has all the same features and
functions available. Consider these best practices when creating ChatOps jobs:
-- GitLab strongly recommends you set `only: [chat]` so the job does not run as part
+- GitLab strongly recommends you set [`rules`](../yaml/index.md#rules) so the job does not run as part
of the standard CI pipeline.
- If the job is set to `when: manual`, ChatOps creates the pipeline, but the job waits to be started.
- ChatOps provides limited support for access control. If the user triggering the
@@ -65,9 +65,13 @@ The output for jobs with a single command is sent to the channel as a reply. For
example, the chat reply of the following job is `Hello World` in the channel:
```yaml
+stages:
+- chatops
+
hello-world:
stage: chatops
- only: [chat]
+ rules:
+ - if: '$CI_PIPELINE_SOURCE == "chat"'
script:
- echo "Hello World"
```
@@ -81,9 +85,13 @@ the `chat_reply` section. For example, the following job lists the files in the
current directory:
```yaml
+stages:
+- chatops
+
ls:
stage: chatops
- only: [chat]
+ rules:
+ - if: '$CI_PIPELINE_SOURCE == "chat"'
script:
- echo "This command will not be shown."
- echo -e "section_start:$( date +%s ):chat_reply\r\033[0K\n$( ls -la )\nsection_end:$( date +%s ):chat_reply\r\033[0K"