
一个结构化且具有明确设计理念的Slack通知资源,适用于Concourse。
!https://raw.githubusercontent.com/arbourd/concourse-slack-alert-resource/main/img/default.png%EF%BC%88%E5%9B%BE%E7%89%87%E5%AE%BD%E5%BA%A660%25%EF%BC%89
消息利用Concourse的资源元数据构建,显示流水线、任务、构建号和URL。
通过在流水线配置的resource_types部分添加以下内容来使用此资源:
yamlresource_types: - name: slack-alert type: docker-image source: repository: arbourd/concourse-slack-alert-resource
有关向流水线配置添加resource_types的更多详情,请参见Concourse文档。
url: 必填。Slack webhook URL。channel: 可选。消息发布的目标频道。若未设置,则使用webhook的默认频道。concourse_url: 可选。指向Concourse的外部URL。默认为环境变量ATC_EXTERNAL_URL。username: 可选。Concourse本地用户(或基本认证)用户名。若使用告警类型fixed或broke,且流水线非公开,则为必填项。password: 可选。Concourse本地用户(或基本认证)密码。若使用告警类型fixed或broke,且流水线非公开,则为必填项。disable: 可选。禁用资源(不发送通知)。默认为false。check: 无操作。in: 无操作。out: 向Slack发送消息。根据告警类型向Slack发送结构化消息。
参数
alert_type: 可选。发送到Slack的告警类型。参见告警类型。默认为default。channel: 可选。消息发布的频道。默认为源配置中的channel设置。channel_file: 可选。包含文本的文件,用于覆盖channel。若无法读取文件,则使用channel。message: 可选。告警顶部的状态消息。默认为告警类型名称。message_file: 可选。包含文本的文件,用于覆盖message。若无法读取文件,则使用message。text: 可选。告警消息下方的附加文本。默认为空字符串。text_file: 可选。包含文本的文件,用于覆盖text。若无法读取文件,则使用text。color: 可选。通知栏的颜色(十六进制值)。默认为告警类型的图标颜色。disable: 可选。禁用此告警。默认为false。告警类型
default
!https://raw.githubusercontent.com/arbourd/concourse-slack-alert-resource/main/img/default.png%EF%BC%88%E5%9B%BE%E7%89%87%E5%AE%BD%E5%BA%A650%25%EF%BC%89
success
!https://raw.githubusercontent.com/arbourd/concourse-slack-alert-resource/main/img/success.png%EF%BC%88%E5%9B%BE%E7%89%87%E5%AE%BD%E5%BA%A650%25%EF%BC%89
failed
!https://raw.githubusercontent.com/arbourd/concourse-slack-alert-resource/main/img/failed.png%EF%BC%88%E5%9B%BE%E7%89%87%E5%AE%BD%E5%BA%A650%25%EF%BC%89
started
!https://raw.githubusercontent.com/arbourd/concourse-slack-alert-resource/main/img/started.png%EF%BC%88%E5%9B%BE%E7%89%87%E5%AE%BD%E5%BA%A650%25%EF%BC%89
aborted
!https://raw.githubusercontent.com/arbourd/concourse-slack-alert-resource/main/img/aborted.png%EF%BC%88%E5%9B%BE%E7%89%87%E5%AE%BD%E5%BA%A650%25%EF%BC%89
fixed
一种特殊告警类型,仅在上一次构建未成功时发送通知。若使用非公开流水线,则需要为资源设置username和password。
!https://raw.githubusercontent.com/arbourd/concourse-slack-alert-resource/main/img/fixed.png%EF%BC%88%E5%9B%BE%E7%89%87%E5%AE%BD%E5%BA%A650%25%EF%BC%89
broke
一种特殊告警类型,仅在上一次构建成功时发送通知。若使用非公开流水线,则需要为资源设置username和password。
!https://raw.githubusercontent.com/arbourd/concourse-slack-alert-resource/main/img/broke.png%EF%BC%88%E5%9B%BE%E7%89%87%E5%AE%BD%E5%BA%A650%25%EF%BC%89
使用默认告警类型,自定义消息和颜色:
yamlresources: - name: notify type: slack-alert source: url: https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX jobs: # ... plan: - put: notify params: message: 已完成 color: "#eeeeee"
使用内置告警类型和相应的构建钩子:
yamlresources: - name: notify type: slack-alert source: url: https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX jobs: # ... plan: - put: notify params: alert_type: started - put: some-other-task on_success: put: notify params: alert_type: success on_failure: put: notify params: alert_type: failed on_abort: put: notify params: alert_type: aborted
使用fixed告警类型:
yamlresources: - name: notify type: slack-alert source: url: https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX # 若流水线为私有,`alert_type: fixed`需要Concourse凭据 username: concourse password: concourse jobs: # ... plan: - put: some-other-task on_success: put: notify params: # 仅在构建成功且为修复状态时发送通知 alert_type: fixed
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
docker search 限制
站内搜不到镜像
离线 save/load
插件要用 plugin install
WSL 拉取慢
安全与 digest
新手拉取配置
镜像合规机制
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
域名连通性排查
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务