gitlab-monitor 配置和使用

作者的GitHub

timoschwarzer/gitlab-monitor

效果展示

在这里插入图片描述

docker-compose.yml

我的docker-compose.yml,提供参考

version: '2'
services:
  gitlab-runner-monitor-testing:
    image: timoschwarzer/gitlab-monitor
    privileged: true
    container_name: gitlab-runner-monitor-testing
    ports:
      - 8686:80
    volumes:
      - /home/XXX/docker-compose-file/gitlab-monitor/testing/config.json:/usr/share/nginx/html/config.json
    networks:
      - gitlab-runner_monitor
    restart: always

networks:
  gitlab-runner_monitor

记得先创建:config.json,具体作用往下看

config.json

我的config.json,提供参考

{
    "gitlabApi":"http://gitlab-url:8989/api/v4",
    "privateToken":"gitlab token",
    "maxAge":36,
    "fetchCount":10,
    "pipelinesOnly":true,
    "autoZoom":true,
    "showPipelineIds":true,
    "showJobs":"iconAndName",
    "showRestartedJobs":true,
    "showStagesNames":false,
    "showDurations":true,
    "showUsers":true,
    "title":"Gitlab monitor title",
    "pollingIntervalMultiplier":1,
    "projectVisibility":"any",
    "membership":false,
    "badges":true,
    "filter":{
        "include":".*",
        "includeTags":".*",
        "exclude":null,
        "excludeTags":null,
        "excludeUntagged":false
    }
}

config.json中配置说明

# 必填,gitlab.example.com -> 换成自己gitlab的地址
gitlabApi: https://gitlab.example.com/api/v4

# 必填,用root账号登录,在settings中的Access Tokens创建token
privateToken: ABCDEF123456

# 时间设置(小时为单位),超过这个时间范围后的项目将不会显示
# 如果设置为:0,则全部显示
maxAge: 168

# 设置我们将从Gitlab中读取多少个项目并显示
# 设置的数字大于100的话,将会读取Gitlab中的所有项目
fetchCount: 20

# 是否只显示有Pipeline的项目
pipelinesOnly: false

# 放大仪表板以使屏幕充满所有显示的项目
# 并不是所有浏览器都兼容
autoZoom: false

# 是否显示Pipeline的id
showPipelineIds: true

# 只显示特定状态的项目
# 可选项有: 'created', 'pending', 'running', 'failed', 'success', 'canceled', 'skipped' or 'manual'.
showProjectOnlyOn:
  - canceled
  - failed
  - pending
  - running
  - skipped
  - manual

# Control how to show job names and icons
# Can be: 'icon', 'name', 'iconAndName'
showJobs: icon

# 只显示特定状态的job
# 可选项有: 'created', 'pending', 'running', 'failed', 'success', 'canceled', 'skipped' or 'manual'.
showJobsNameOnlyOn:
  - canceled
  - failed
  - pending
  - running
  - skipped
  - manual

# 是否显示那些重新执行的job
showRestartedJobs: true

# 是否显示stage的名字
showStagesNames: false

# 是否持续的显示pipeline
showDurations: true

# 是否显示触发pipeline的用户名
showUsers: false

# 定义我们gitlab-monitor的名字/标题
title: null

# 将所有轮询间隔乘以这个量
# (例如,0.5将使gitlab-monitor轮询频率增加一倍)
pollingIntervalMultiplier: 1.0

# 根据可见性限制项目
# 可选项有: 'any', 'public', 'internal' or 'private'
projectVisibility: any

# Limit by projects that the current user is a member of
membership: false

# 是否显示项目徽章
badges: true

# 项目过滤
# 根据路径名称过滤
# (e.g. 'my-group/my-project'
filter:

  # 包含符合以下正则表达式的项目
  include: .*

  # 包含符合以下正则表达式的tag的项目
  includeTags: .*

  # 不包含....
  exclude: null

  # 不包含....
  excludeTags: null

  # 不包含没有任何tags的项目
  excludeUntagged: false

# 项目配置
projectConfig:

  # 星号选择所没有自己配置的项目
  '*':

    # 包含符合以下正则表达式的branch的项目
    include: .*

    # 不包含以下正则表达式的branch的项目
    exclude: null

    # 覆盖默认分支(用于卡片背景颜色)。如果不设置,将会使用项目的默认分支。
    # 黑人问号???
    default: null

    # 是否显示merge的项目
    showMerged: true

    # 是否显示pipelines的tag
    showTags: true

    # 此过滤器要显示的最小pipeline数量
    historyCount: 1

    # 隐藏跳过的pipeline
    hideSkippedPipelines: false

    # 声音警告
    soundAlerts:
      # 如果设置了一个非空的值,此功能将开启
      # 将null替换成声音文件的URL地址
      # IMPORTANT: 由于某些浏览器将会阻止自动播放音频,你可能需要先手动开启自动播放
      #  Firefox:  https://support.mozilla.org/en-US/kb/block-autoplay
      soundUrl: null

      # 符合以下正则表达式的branch的项目,将会触发此功能
      include: .*

      # 排除符合以下正则表达式的branch的项目,将不会触发此功能
      exclude: null

  # 为某个项目设置特定的过滤条件
  my-project/my-group":
    # see above...

# 通过API路由查找项目
# 允许的值有:"groups" and "users"
projectScope: null

# 和projectScope搭配使用
# 假如projectScope:groups,projectScopeId: 123,则会以这个路由查找:/groups/123/projects
# 使用数组的方式,支持多个id的查询
projectScopeId: null

# 如果projectScope选择的是groups
# 这里可以控制是否包含subgroup的project
includeSubgroups:  false

# 主题选择
# null -> 默认主题
# 可选:nord-dark, nord-light
theme: null

启动

docker-compose up -d

其他

从VirtualBox到Docker到Gitlab的安装
Gitlab CICD官网翻译
MySQL安装 & 使用
JDK安装 & 版本查看
中间件Solace pubsub+安装时抛time out
Upsource安装 & 使用
Docker安装Gitlab runner
Docker部署Gitlab,ssh端口不用22的解决方法
Docker部署Gitlab,http端口不用80的解决方法
Gitlab runner的注册 & 使用
gitlab-monitor 配置和使用
Upsource集成Gitlab的身份验证

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值