YAML Schema
resources: - name:type: OutgoingWebhook configuration: webhookName: # name of an Outgoing Webhook Integration method: # default POST Parameters: # query string to be appended to the outgoing URL path: headers: Content-type: accept: xyc
Tags
name
Analphanumericstring (underscores are permitted) that identifies the resource.
type
Must beOutgoingWebhookfor this resource type.
configuration
Specifies all configuration selections for the resource.
Tag |
Description |
Required/Optional |
|---|---|---|
webhookName |
The name of anOutgoing Webhook Integration | Required |
method |
所使用的HTTP方法:| | |后删除| PATCH The default is POST. |
Optional |
Parameters |
A query string to be appended to the outgoing URL | Optional |
path |
Path for the outgoing URL | Optional |
headers |
Any HTTP entity headers to include. For example,content-typeto specify any the type of content returned. |
Optional |
Environment Variables
WheneverWebhookis used in a step, a set of environment variables is automatically made available that you can use in your step.
Environment Variable |
Description |
|---|---|
|
Name of the resource |
res_ |
The JSON payload attached to the resource |
res_ |
When set totrue, the outgoing webhook will not be sent. This is useful to inhibit sending of a prepared webhook in a step's Defaults tofalse. |
Examples
The Pipelines DSL for this example is available inthis repositoryin theJFrogGitHub account.
Example 1
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"
Example 2
resources: - name: MyOutgoingJSONResource type: OutgoingWebhook configuration: webhookName: MyOutgoingJSONResource path: /json pipelines: - name: ExamplePipeline steps: - name: my_send_hook_json type: Bash configuration: outputResources: - name: MyOutgoingJSONResource execution: onExecute: - jsonPayload="{\"runNumber\":\"$run_number\", \"stepName\":\"$step_name\"}" - set_payload MyOutgoingJSONResource "$jsonPayload" onFailure: - export res_MyOutgoingJSONResource_skipWebHook=true onSuccess: - echo "Payload sent by "$res_MyOutgoingJSONResource_name":" - echo $res_MyOutgoingJSONResource_payload

