Gitlab-Webhook-Robot

项目地址:EalenXie/gitlab-webhook-robot: Java版 Gitlab Webhook + 机器人通知 (github.com)

git下载如上项目到本地:

修改 application.yaml

root@nx-eks-ctl:/usr/local/src/zhdya/gitlab-webhook/gitlab-webhook-robot-master/src/main/resources# cat application.yml
server:
  port: 8787

webhook:
  enable-emoji: true
  way: wechat
  ding:
    access-token: 93a93799cde9xxxxxx655ae0d4eb9872883c
    sign-key: SECcd68c6b173xxxxxxxc48739c6141a891c9
  wechat:
    key: f610cb05-3853-xxxx-823c-8b12707acdf3		##wechat webhook key
  feishu:
    url: https://open.feishu.cn/open-apis/bot/v2/hook/4ad2ff7d-xxxx-4ef0-84be-ee6
    signKey:
gitlab:
  enable: true
  host: http://172.31.22.76			##GITLAB的地址
  private-token: TJ
spring:
  application:
    name: @artifactId@
  banner:
    location: banner.txt

编译:

cd gitlab-webhook-robot-master/
mvn clean package -Dmaven.test.skip=true

编译运行:

# docker build -t gitlab-webhook:v1 .

# docker run -d -m 512m --network=host --restart=always -v /opt/logs/:/opt/logs -v /etc/localtime:/etc/localtime gitlab-webhook:v1 --spring.profiles.active=dev

# docker logs -f 09042b40e754

2022-06-23 11:18:46.192  INFO 1 --- [           main] i.g.ealenxie.GitlabWebhookApplication    : Started GitlabWebhookApplication in 2.949 seconds (JVM running for 3.476)
2022-06-23 11:18:46.194  INFO 1 --- [           main] i.g.e.gitlab.GitlabCommandLineRunner     : Gitlab config enable, You can call the section's Gitlab API resource by GitlabEndpoint
2022-06-23 11:18:46.195  INFO 1 --- [           main] i.g.e.gitlab.GitlabCommandLineRunner     : The message sending way is wechat , Please fill in this address in your Gitlab Webhook: http://172.31.22.76:8787/actuator/gitlab/webhook

效果:

配置:


本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!