Giter Site home page Giter Site logo

tigerlee / gitlab-bot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from treadpit/gitlab-bot

0.0 1.0 0.0 3.81 MB

将Gitlab的push、tag push、merge request和pipeline推送到企业微信/钉钉的机器人

Home Page: https://blog.xqopen.com/gitlab-bot

JavaScript 99.38% Dockerfile 0.62%

gitlab-bot's Introduction

Gitlab通知机器人

Gitlabpushtag pushmerge requestpipeline推送到企业微信的机器人。

具体见下图:

Gitlab push 代码推送

alt gitlab-push-msg-1

Gitlab push 新建分支

alt gitlab-push-msg-2

Gitlab push 删除分支

alt gitlab-push-msg-3

Gitlab push tag 推标签

alt gitlab-push-tag-msg-1

Gitlab merge request 合并请求

alt gitlab-mr-msg-1

Gitlab pipeline 流水线

alt gitlab-pipeline-msg

钉钉消息预览图

dingtalk

区分平台

  • WEXIN_WEBHOOK_URL_ 企业微信

  • DINGTALK_WEBHOOK_URL_ 钉钉

以下章节内容中以 WEBHOOK_URL_ 代指各平台,自行根据情况替换为对应平台环境变量名

与企业微信对接

如何添加群机器人可自行百度。企业微信 群机器人配置说明

与钉钉对接

如何添加群机器人可自行百度。钉钉 群机器人配置说明

应用部署运行

应用通过环境变量添加机器人webhook地址,WEBHOOK_URL_作为前缀,后面可接不同的推送组。

如环境变量WEBHOOK_URL_PROJPROJ则为推送组。推送组用于与Gitlab的集成时使用。

例如:

则环境变量设为:

WEBHOOK_URL_QYWX=https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=ABCDEFG

一个应用可以添加多个推送组。

使用Docker部署

修改docker-compose.yml文件中的WEBHOOK_URL环境变量,添加企业微信机器人webhook地址。

docker-compose up -d

通过:7001端口访问服务。

直接运行

首先系统安装了node运行环境。

WEBHOOK_URL_PROJ=https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=ABCDEFG npm start

通过:7001端口访问服务。

与Gitlab集成

进到项目,settings => integrations

URL填写服务的地址和端口号+推送组。

例如,服务器地址为:https://192.168.100.100:7001,推送组为PROJ。

URL填写:https://192.168.100.100:7001/proj

具体设置,参见下图:

alt gitlab集成图片

gitlab-bot's People

Contributors

treadpit avatar zhoubox avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.