JFrog帮助中心

我们的新传送门很快就要来了!
文档+知识库





JFrog帮助中心-一个全新的知识体验即将到来!



概述

一个OutgoingWebhook资源使用HTTP将信息从步骤发送到外部API端点外向Webhook集成


当一个OutgoingWebhook 资源指定为 outputResource 对于一个步骤 有一个附加有效载荷(包括一个空有效载荷), 步骤执行完成后,将有效负载发送到中指定的端点外向Webhook集成.如果需要,可以通过设置资源的skipWebhook环境变量为真正的

要附加传出有效负载,请使用set_payload效用函数。如果没有附加有效负载,则没有消息通过webhook发送。

页面内容


YAML模式

2022世界杯阿根廷预选赛赛程resources:—name:  type: OutgoingWebhook configuration: webhookName:  # OutgoingWebhook的名称Integration method:  # default POST参数: # query string to be appendable to Outgoing URL path:  headers: content -type: <有效请求内容类型> accept: xyc

标签

的名字

一个字母数字标识资源的字符串(允许使用下划线)。

类型

必须OutgoingWebhook对于此资源类型。

配置

指定资源的所有配置选择。

标签

描述

必需的/可选
webhookName 的名称外向Webhook集成 要求
方法

HTTP方法:GET | PUT | POST | DELETE | PATCH

默认为POST。

可选
参数 要追加到传出URL的查询字符串 可选
路径 传出URL的路径 可选
任何要包含的HTTP实体头。例如,内容类型来指定返回的任何类型的内容。 可选

环境变量

每当Webhook在步骤中使用时,将自动提供一组可在步骤中使用的环境变量。

环境变量

描述

res_ < resource_name > _name
资源名称
res_ < resource_name > _payload 附加到资源的JSON有效负载
res_ < resource_name > _skipWebhook

当设置为真正的,发出的webhook将不会被发送。这对于抑制在一个步骤中发送一个准备好的webhook是有用的onFailure部分。

默认为


例子

本例的管线DSL可在这个存储库JFrogGitHub帐户。

示例1

外向表单URL Webhook
2022世界杯阿根廷预选赛赛程resources:—name: My_OutHook_formurl_Resource type: OutgoingWebhook configuration: webhookName: My_OutgoingWebhookIntegration path: /url headers: content-type: application/x-www-form-urlencoded pipelines:—name: ExamplePipeline steps:—name: my_send_hook_formurl type: Bash configuration: outputResources:—name: My_OutHook_formurl_Resource execution: onExecute:- echo "hello world" - formUrlEncodedPayload="foo=bar&runNumber=$run_number&stepName=$step_name" - set_payload My_OutHook_formurl_Resource "$formUrlEncodedPayload"

示例2

传出JSON Webhook
2022世界杯阿根廷预选赛赛程资源:- name: MyOutgoingJSONResource类型:OutgoingWebhook配置:webhookName: MyOutgoingJSONResource路径:/json pipeline: - name: ExamplePipeline步骤:- name: my_send_hook_json类型:Bash配置:outputResources: - name: MyOutgoingJSONResource执行:onExecute: - jsonPayload="{\"runNumber\":\"$run_number\", \"stepName\":\"$step_name\"}" - set_payload MyOutgoingJSONResource "$jsonPayload" onFailure: - export res_MyOutgoingJSONResource_skipWebHook=true onSuccess:- echo $res_MyOutgoingJSONResource_name发送的有效载荷
  • 没有标签
版权所有©2023 JFrog Ltd。