Webhooks

Sections

Webhooks provide a secure mechanism to make an HTTP POST based on a Puppet Pipelines event. The events that can trigger a webhook include:

  • Application Build Begins
  • Application Build Finishes
  • Environment Deploy Begins
  • Environment Deploy Finishes

Puppet Pipelines webhooks communicate with a webhook server in your environment. This means any firewall must allow Pipelines to reach your webhook server on port 80 and/or port 443 (or other TCP port you may configure for your webhook) and allow the return response from your webhook server to Puppet Pipelines.

webhooks build

webhooks deploy

Create a webhook

There are two types of webhooks:

  • Application build webhooks - Configured in application settings
  • Environment deploy webhooks - Configured in environment settings
  1. Navigate to the application settings (builds) or environment settings (deploys).
  2. Expand the Webhooks section.
  3. webhooks build webhooks deploy
  4. Ensure the Enable Webhooks ... checkbox is checked.
  5. Click the Add a Webhook Type drop down.
  6. Select the event you wish to receive a webhook for.
  7. webhook add
  8. Enter a unique Friendly Name for the webhook. Friendly names may not contain spaces or special characters.
  9. Enter a webhook URL.
  10. Some example webhook URLs include:

    • http://192.0.2.25
    • https://192.0.2.25
    • http://webhook.example.com/build_started
    • http://webhook.example.com:8080
    • https://hook2.example.com:8443?userid=abc123&task=build_start
  11. Enter a secret, if the host requires one.
  12. A webhook secret is configured on the webhook server and the webhook client (Puppet Pipelines), and must match for webhooks to be accepted by the webhook server. Not all webhook servers are configured with a secret. Talk to your webhook server administrator to determine if a secret is required.

Webhook body

Each webhook contains a JSON-formatted body of information regarding the event that occured.

Build Started

{
    api_url:https://www.distelli.com/jdoe/builds/6982
    app_name:rubyubunturbenvapp
    build_num:6982
    build_server:null
    commit:
    Object: {
        branch:master
        commit_id:2670a8bf48bbc326833b24854c6559b82577a832
        committer:doct15
        date:null
        msg:Update distelli-manifest.yml
        repo_name:rubyubunturbenvapp
        repo_owner:doct15
        url:https://github.com/doct15/rubyubunturbenvapp/commit/2670a8bf48bbc326833b24854c6559b82577a832
    }
    create_time:2015-11-20T23:43:01Z
    dependencies:null
    deployments:null
    end_time:null
    html_url:https://www.distelli.com/jdoe/builds/6982
    release_url:null
    release_version:null
    start_time:null
    status:Queued
}

Build Finished

{
    api_url:https://www.distelli.com/jdoe/builds/6982
    app_name:rubyubunturbenvapp
    build_num:6982
    build_server:null
    commit:
    Object: {
        branch:master
        commit_id:2670a8bf48bbc326833b24854c6559b82577a832
        committer:doct15
        date:null
        msg:Update distelli-manifest.yml
        repo_name:rubyubunturbenvapp
        repo_owner:doct15
        url:https://github.com/doct15/rubyubunturbenvapp/commit/2670a8bf48bbc326833b24854c6559b82577a832
    }
    create_time:2015-11-20T23:43:01Z
    dependencies:null
    deployments:Array: []
    end_time:2015-11-20T23:43:90Z
    html_url:https://www.distelli.com/jdoe/builds/6982
    release_url:https://www.distelli.com/jdoe/apps/rubyubunturbenvapp/releases/v54
    release_version:v54
    start_time:2015-11-20T23:43:10Z
    status:Success
}

Deploy Started

{
    api_url:https://www.distelli.com/jdoe/deployments/44933
    app_name:RubyUbuntuRbenvApp
    app_url:https://www.distelli.com/jdoe/apps/RubyUbuntuRbenvApp
    deployer:jdoe
    deployment_id:d-gigh44erc1db875a98d
    deployment_number:44933
    deployment_state:InProgress
    deployment_time:2015-11-19T01:37:63Z
    deployment_type:Deploy
    env_name:rubyubunturbenvapp-beta
    env_url:https://www.distelli.com/jdoe/envs/rubyubunturbenvapp-beta
    html_url:https://www.distelli.com/jdoe/deployments/44933
    release_url:https://www.distelli.com/jdoe/apps/RubyUbuntuRbenvApp/releases/v53
    release_version:v53
    servers:
    Object: {
        done:0
        failed:0
        in_progress:0
        pending:0
        waiting:1
    }
    servers_url:https://www.distelli.com/jdoe/deployments/d-gigh44erc1db875a98d/servers
    stagger_delay:60
    stagger_size:1
}

Deploy Finished

{
    api_url:https://www.distelli.com/jdoe/deployments/44933
    app_name:RubyUbuntuRbenvApp
    app_url:https://www.distelli.com/jdoe/apps/RubyUbuntuRbenvApp
    deployer:jdoe
    deployment_id:d-gigh44erc1db875a98d
    deployment_number:44933
    deployment_state:Failed
    deployment_time:2015-11-19T01:37:63Z
    deployment_type:Deploy
    env_name:rubyubunturbenvapp-beta
    env_url:https://www.distelli.com/jdoe/envs/rubyubunturbenvapp-beta
    html_url:https://www.distelli.com/jdoe/deployments/44933
    release_url:https://www.distelli.com/jdoe/apps/RubyUbuntuRbenvApp/releases/v53
    release_version:v53
    servers:
    Object: {
        done:0
        failed:1
        in_progress:0
        pending:0
        waiting:0
    }
    servers_url:https://www.distelli.com/jdoe/deployments/d-gigh44erc1db875a98d/servers
    stagger_delay:60
    stagger_size:1
}
How helpful was this page?
Puppet sites use proprietary and third-party cookies. By using our sites, you agree to our cookie policy.