Cloud customer?
 Upgrade in MyJFrog >

Search





Overview

A Webhook is an automated notification mechanism that is triggered by events that you define. When a webhook is triggered, it sends relevant information about the event to a web location that is listening for that specific event notification. The webhook is comprised of three simple components – the triggering event, the information about the event (the “payload”), and the web location listening for the event.

As a JFrog Platform administrator, you will be able to use Webhooks to trigger an action in another service in response to an event in Artifactory, either to notify users of the event or trigger some automated flow.

Since Artifactory plays an important role in the build and distribution process of your artifacts, it is helpful to know when important events are occuring. Webhooks enables you to be notified or notify other users when such events take place in Artifactory. 

Webhooks enables you to integrate Artifactory processes with third party applications that are also essential to your build process. Some Artifactory events may trigger a process in another application, such as Jira, and Jenkins. For example, when a certain event is triggered, such as build promotion, Artifactory will send an HTTP POST payload to the Webhook’s configured URL and trigger a CI build in Jenkins. 

How does it work?

Webhooks is based on the JFrog Event Service. This microservice is responsible for the distribution of your Webhook events asynchronously. To learn more about it, see System Architecture

Page Contents


Creating Webhooks in the JFrog Platform

To start creating Webhooks, do the following:

  1. Navigate to Administration Module | General | Webhooks. 
  2. Click New Webhook.




  3. Enter the details of the following fields:

    FieldDescription

    URL

    Specifies the URL that the Webhook invokes. This will be the URL that Artifactory will send an HTTP POST request to.

    Use Proxy

    Indicates whether to send the Webhook through a proxy. You can select a proxy from the configured proxy servers list.

    Event

    Displays the list of Events in Artifactory, Xray, and Distribution that function as the event trigger for the Webhook. 

    Secret Token

    Defines a secret authentication token that will be sent to the configured URL.

    Custom Headers

    Adds custom headers you wish to use to invoke the Webhook.

    By default, private networks are not allowed to be used as Webhook targets for security reasons. If you would like to allow use of a private network, change the URL strict policy configuration in the system.yaml file

  4. Some events can be applied to repositories and/or builds:

    Events such as artifact was deployed, moved, added can be applied on every repository in Artifactory or on a list of specific repositories, based on a specific list or by using include/exclude patterns. 

    Take note, if you select any local and/or remote repository, the Webhook will be applied on all existing repositories and any repositories you create in the future.


    Events such as build was deployed, promoted, deleted can be applied on every new build that is uploaded to Artifactory or on a list of specific builds, based on a specific list or by using include/exclude   patterns. 
       


Testing a Webhook

You can test a Webhook using the Test button in the UI, to check the connectivity between Artifactory and the configured URL. The Webhook will be triggered manually, and a dummy payload will be sent to the configured URL.


Event Types

The following are the supported event types according to each domain with an example for each event of the payload that will be sent to the configured URL.


Domain: Artifact

Includes events that are triggered when certain artifact events occur in Artifactory:

Event: deployed

The Webhook is triggered when an artifact is deployed to a repository. You can select the repositories and repository paths on which the Webhook will be applied.

Artifact was Deployed
{
  "repo_key":"sample_repo",
  "path":"sample_path_dir/sample_artifact",
  "name":"sample_artifact",
  "sha256":"ec1be623d148ed220f70f4f6125dc738b1d301a85b75e87c5b554fa3bb1b4141",
  "size":17848
}

Event: deleted

The Webhook is triggered when an artifact is deleted from a repository. You can select the repositories on which the Webhook will be applied.

Artifact was Deleted
{
  "repo_key":"sample_repo",
  "path":"sample_path_dir/sample_artifact",
  "name":"sample_artifact",
  "sha256":"ec1be623d148ed220f70f4f6125dc738b1d301a85b75e87c5b554fa3bb1b4141",
  "size":17848
}

Event: moved

The Webhook is triggered when an artifact is moved from a repository. You can select the repositories and repository paths on which the Webhook will be applied. The Webhook will apply on the repositories from which the artifact is moved.

Artifact was Moved
{
  "repo_key":"sample_repo",
  "path":"sample_path_dir/sample_artifact",
  "name":"sample_artifact",
  "size":0,
  "source_repo_path":"sample_repo/sample_path_dir/sample_artifact",
  "target_repo_path":"target_repo/sample_path_dir/sample_artifact"
}

Event: copied

The Webhook is triggered when an artifact is copied from a repository. You can select the repositories and repository paths on which the Webhook will be applied. The Webhook will apply on the repositories from which the artifact is copied.

Artifact was Copied
{
  "repo_key":"sample_repo",
  "path":"sample_path_dir/sample_artifact",
  "name":"sample_artifact",
  "size":0,
  "source_repo_path":"sample_repo/sample_path_dir/sample_artifact",
  "target_repo_path":"target_repo/sample_path_dir/sample_artifact"
}

Domain: Artifact Properties

Includes events that are triggered when certain artifact property actions occur in Artifactory:

Event: added

The Webhook is triggered when a property is added to an artifact/folder in a repository, or the repository itself. You can select the repositories and repository paths on which the Webhook will be applied.

Artifact Property was Added
{
   "repo_key":"sample_repo",
   "path":"sample_path_dir/sample_artifact",
   "name":"sample_artifact",
   "sha256":"ec1be623d148ed220f70f4f6125dc738b1d301a85b75e87c5b554fa3bb1b4141",
   "size":17848,
   "property_key":"sample_prop_key",
   "property_values":[
   "sample_value"
 ]
}

Event: deleted

The Webhook is triggered when a property is deleted from an artifact/folder in a repository, or the repository itself. You can select the repositories and repository paths on which the Webhook will be applied.

Artifact Property was Deleted
{
  "repo_key":"sample_repo",
   "path":"sample_path_dir/sample_artifact",
   "name":"sample_artifact",
   "sha256":"ec1be623d148ed220f70f4f6125dc738b1d301a85b75e87c5b554fa3bb1b4141",
   "size":17848,
   "property_key":"sample_prop_key",
   "property_values":[
   "sample_value"
 ]
}

Domain: Docker

Includes events that are triggered when certain Docker-related events occur in Artifactory:

Event: pushed

The Webhook is triggered when a new tag of a Docker image is pushed to a Docker repository. You can select the Docker repositories and repository paths on which the Webhook will be applied.

Docker Tag was Pushed
{
   "repo_key":"docker-remote-cache",
   "path":"library/ubuntu/latest/list.manifest.json",
   "name":"list.manifest.json",
   "sha256":"35c4a2c15539c6c1e4e5fa4e554dac323ad0107d8eb5c582d6ff386b383b7dce",
   "size":1206,
   "image_name":"library/ubuntu",
   "tag":"latest",
   "platforms":[
      {
         "architecture":"amd64",
         "os":"linux"
      },
      {
         "architecture":"arm",
         "os":"linux"
      },
      {
         "architecture":"arm64",
         "os":"linux"
      },
      {
         "architecture":"ppc64le",
         "os":"linux"
      },
      {
         "architecture":"s390x",
         "os":"linux"
    }
  ]
}

Event: deleted

The Webhook is triggered when a tag of a Docker image is deleted from a Docker repository. You can select the Docker repositories and repository paths on which the Webhook will be applied.

Docker Tag was Deleted
{
  "repo_key": "sample_repo",
  "path": "path/sample.txt",
  "name": "sample.txt",
  "sha256": "sample_checksum",
  "size": 0,
  "image_name": "sample_arch",
  "tag": "sample_image",
  "platforms": [
    {
      "architecture": "sample_os",
      "os": "sample_tag"
    }
  ]
}

Event: promoted

The Webhook is triggered when a tag of a Docker image is promoted. You can select the Docker repositories and repository paths on which the Webhook will be applied. The Webhook will apply on the Docker repositories from which the Docker tag was promoted.

Docker Tag was Promoted
{
  "repo_key": "sample_repo",
  "path": "path/sample.txt",
  "name": "sample.txt",
  "sha256": "sample_checksum",
  "size": 0,
  "image_name": "sample_arch",
  "tag": "sample_image",
  "platforms": [
    {
      "architecture": "sample_os",
      "os": "sample_tag"
    }
  ]
}

Domain: Build

Includes events that are triggered when certain build-related events occur in Artifactory:

Event: uploaded

The Webhook is triggered when a new build is uploaded. You can select the build names or build patterns on which the Webhook will be applied.

Build was Uploaded
{
  "build_name":"sample_build_name",
  "build_number":"1",
  "build_started": "2020-06-18T14:40:49.869+0300"
 }
}

Event: deleted

The Webhook is triggered when a build is deleted. You can select the build names or build patterns on which the Webhook will be applied.

Build was Deleted
{
  "build_name":"sample_build_name",
  "build_number":"1",
  "build_started": "2020-06-18T14:40:49.869+0300"
 }
}

Event: promoted

The Webhook is triggered when a build is promoted. You can select the build names or build patterns on which the Webhook will be applied.

Build was Promoted
{
  "build_name":"sample_build_name",
  "build_number":"1",
  "build_started": "2020-06-18T14:40:49.869+0300"
 }
}

Webhooks REST API Support

To use REST API for creating, updating, and deleting Webhooks, see Webhooks APIs.

  • No labels
Copyright © 2020 JFrog Ltd.