GitLab may not work properly because you are using an outdated web browser.
Please install a supported web browser for a better experience.

GitLab ChatOps

GitLab ChatOps provides a method to interact with CI/CD jobs through chat services like Slack. Many organizations' discussion, collaboration, and troubleshooting is taking place in chat services these days, and having a method to run CI/CD jobs with output posted back to the channel can significantly augment a team's workflow.

NOTE: Note: ChatOps is currently in alpha with some important features missing, like access control.

How it works

GitLab ChatOps is built upon two existing features:

A new run action has been added to the slash commands, which takes two arguments: a <job name> to execute and the <job arguments>. When executed, ChatOps will look up the specified job name and attempt to match it to a corresponding job in .gitlab-ci.yml. If a matching job is found on master, a pipeline containing just that job is scheduled. Two additional CI/CD variables are passed to the job: CHAT_INPUT contains any additional arguments, and CHAT_CHANNEL is set to the name of channel the action was triggered in.

After the job has finished, its output is sent back to Slack provided it has completed within 30 minutes. If a job takes more than 30 minutes to run it must use the Slack API to manually send data back to a channel.

Developer access and above is required to use the run command. If a job should not be able to be triggered from chat, it can be set to except: [chat].

Creating a ChatOps CI job

Since ChatOps is built upon GitLab CI/CD, the job has all the same features and functions available. There a few best practices to consider however when creating ChatOps jobs:

  • It is strongly recommended to set only: [chat] so the job does not run as part of the standard CI pipeline.
  • If the job is set to when: manual, the pipeline will be created however the job will wait to be started.
  • It is important to keep in mind that there is limited support for access control. If the user who triggered the slash command is a developer in the project, the job will run. The job itself can utilize existing CI/CD variables like GITLAB_USER_ID to perform additional rights validation, however these variables can be overridden.

Controlling the ChatOps reply

For jobs with a single command, its output is automatically sent back to the channel as a reply. For example the chat reply of the following job is simply Hello World.

hello-world:
  stage: chatops
  only: [chat]
  script:
    - echo "Hello World."

Jobs that contain multiple commands, or have a before_script, include additional content in the chat reply. In these cases both the commands and their output are included, with the commands wrapped in ANSI colors codes.

To selectively reply with the output of one command, its output must be bounded by the chat_reply section. For example, the following job will list the files in the current directory.

ls:
  stage: chatops
  only: [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"

GitLab ChatOps icon

Say Hi to our ChatOps bot. You can find and download the official GitLab ChatOps icon here.

GitLab ChatOps bot icon

Download bigger image

线上太阳城信誉网址-真人太阳城开户注册-现金太阳城娱乐平台 线上永利直营注册 现金威尼斯人 直营网址 真人新濠天地开户 现金美高梅网址直营 现金威尼斯人注册 真人平台娱乐 现金葡京开户网址 线上直营 现金平台注册 太阳城平台注册 注册开户 真人直营 真人网址平台
网址平台 真人平台网址 开户直营 现金太阳城直营开户 现金网址平台 真人太阳城娱乐开户 太阳城网址平台 线上网址 平台开户 太阳城注册直营 真人开户注册 现金太阳城平台注册 现金注册网址 真人注册娱乐 真人太阳城娱乐直营 真人太阳城娱乐网址 太阳城注册娱乐 线上注册 现金太阳城直营平台 现金太阳城注册直营 真人太阳城 现金太阳城平台直营 真人太阳城平台注册 现金网址平台 现金开户娱乐 真人娱乐平台 线上开户娱乐 线上太阳城直营娱乐 真人太阳城平台注册 线上太阳城平台开户 真人太阳城平台注册 真人平台娱乐 太阳城开户平台 线上太阳城网址开户 线上网址 真人直营 真人太阳城网址开户 线上开户注册 线上注册开户 太阳城娱乐注册 太阳城平台网址 线上太阳城平台直营 现金太阳城平台 真人太阳城网址注册 线上注册平台 线上注册平台 线上太阳城平台直营 太阳城平台直营 现金平台 现金太阳城平台注册 开户直营 线上开户娱乐 真人太阳城开户直营 现金太阳城网址娱乐 现金网址 线上太阳城注册网址 现金网址开户 现金太阳城平台注册 直营娱乐 直营开户 真人网址娱乐 真人平台 太阳城平台注册 线上太阳城平台开户 线上平台直营 线上太阳城注册平台 注册开户 线上注册直营 真人开户娱乐 现金太阳城直营 线上太阳城娱乐网址 现金太阳城网址直营 线上注册开户 现金娱乐网址 现金太阳城注册直营 真人太阳城平台开户 现金太阳城开户 现金太阳城开户网址 线上直营开户 现金太阳城直营 现金娱乐直营 太阳城开户直营 开户娱乐 真人太阳城平台直营 线上注册娱乐 真人注册开户 线上太阳城注册开户 平台网址 真人太阳城平台开户 现金太阳城娱乐 线上太阳城直营网址 现金注册平台 现金太阳城注册娱乐 现金娱乐 线上太阳城直营平台 现金太阳城注册开户 真人娱乐 线上太阳城直营开户 太阳城直营 现金太阳城平台 真人太阳城网址平台 真人太阳城注册平台 线上太阳城注册娱乐 线上网址 现金注册直营 真人太阳城直营娱乐 线上太阳城开户娱乐 真人太阳城直营 线上太阳城娱乐网址 线上太阳城平台 真人太阳城开户注册 线上网址娱乐 现金太阳城娱乐开户 线上太阳城注册网址 现金太阳城直营 现金直营网址 线上太阳城平台 太阳城网址注册 现金开户 真人太阳城平台开户 真人注册网址 线上娱乐 真人直营网址 真人太阳城平台 真人太阳城网址 线上太阳城开户直营 线上太阳城娱乐注册 线上太阳城平台娱乐 注册直营 太阳城娱乐直营 直营网址 真人娱乐平台 现金太阳城网址直营 真人网址平台 现金太阳城平台注册 太阳城直营开户 线上太阳城平台网址 真人网址娱乐 线上太阳城开户直营 娱乐开户 真人太阳城直营开户 线上平台注册 线上太阳城网址开户 现金太阳城网址平台 现金太阳城平台娱乐 真人太阳城网址娱乐 真人太阳城开户直营 真人直营开户 太阳城开户平台 线上太阳城开户平台 真人太阳城开户网址 娱乐网址 现金太阳城直营开户 注册直营 线上太阳城娱乐直营 现金太阳城注册平台 现金太阳城注册直营 现金平台娱乐 线上平台开户