Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
1acacf18
Commit
1acacf18
authored
Aug 10, 2021
by
Steve Azzopardi - Out Of Office back 2021-08-16
Committed by
Marcel Amirault
Aug 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs(chatops): update example to use rules
parent
8b1b2b67
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
doc/ci/chatops/index.md
doc/ci/chatops/index.md
+11
-3
No files found.
doc/ci/chatops/index.md
View file @
1acacf18
...
...
@@ -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"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment