Cloud customer?
Start for Free>
Upgrade in MyJFrog >
What's New in Cloud >





A Slack integration is required to send notifications to Slack channels or rooms for pipeline events (to learn more about the Slack integration, seeArtifactory and Xray Integration with Slack).

Creating an Integration

  • Follow instructions in the Slack docs to创建一个传入webhook. While you should specify a default or popular channel while creating the webhook, it can be overriden in your pipeline source when needed.
  • Copy the text in theWebhook URLsection. It looks like this:
    https://hooks.slack.com/services/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
  • To add your integration, follow steps on theManaging Pipelines Integrationspage.

    Here is the information you need to create this integration:
    • Name-- choose a friendly name for the integration
    • Webhook url-- Webhook URL to your Slack channel
Page Contents


Usage

TheSlackintegrationcanbe added directly to a step in theintegrationssection.

Thesend_notificationutility function can be used with aSlackintegration to send a notification message.

For more information, seeSending Notifications from Pipelines.

Default Environment Variables

When you add this integration to a step, a set of environment variables is automatically made available.

Environment variable

Description

int__url Webhook URL to your Slack channel

Example

  • This example uses a Slack integration namedmySlack.
  • Thesend_notificationutility function is used to sendtheonStartandonExecutenotifications.
  • The YAML for this example isavailable inthis repositoryin theJFrogGitHub account.
Sending notifications
pipelines: - name: pipe1 steps: - name: test_step_1 type: Bash configuration: integrations: - name: mySlack # This is the name of the Slack integration you created in your test instance execution: onStart: - send_notification mySlack --text "starting test_step_1" # replace 'mySlack' with the name of your Slack integration onExecute: - send_notification mySlack --text "onExecute, past test commands" # replace 'mySlack' with the name of your Slack integration onSuccess: - send_notification mySlack # without '--text' to send a generic notification that includes the pipeline name and step name
  • 没有标签
Copyright © 2023 JFrog Ltd.