Notifications

JFrog Pipelines Documentation

Products
JFrog Pipelines
Content Type
User Guide
ft:sourceType
Paligo

send_notification

Description

Utilizes notification integration to send custom messages at any time during the build to any recipient.

For more information, see Sending Notifications from Pipelines.

Usage

send_notification <integration> [options]

The options can be specified as part of the command, or defined as environment variables before the command is issued.

The command line arguments take priority over the environment variables.

AirBrake

Creates an AirBrake deployment through an Airbrake Integration. Not supported in PowerShell.

Bash

Option Description

--project-id

the project ID to send the notification for

--environment

the environment value to use when posting the deployment

--username

used when posting an AirBrake deployment

--email

the email to be used when posting the AirBrake deployment

--repository

the repository to use when posting the AirBrake deployment

--revision

the deployment revision

--version

the version to use when posting the AirBrake deployment

--type

currently only type “deploy” is supported

--description

description of the deployment

--payload

path to a valid JSON file that contains a payload to use to POST the AirBrake deployment

Jira

Creates a Jira issue (also known as a ticket).

Bash

PowerShell

Option Description

--project-id

-project-id

the Project Key of the project to associate the new issue with. The project key is the short string that begins all issue numbers for the project (e.g., "EXAMPLE-1234")

--type

-type

the issue type for the new issue (e.g., "Bug", "Task", etc.). This string must be one of the recognized Jira issue types

--summary

-summary

a string for the new issue's Summary field (it's title)

--description

--description

(optional) a string for the new issue's Description field

--attach-file

--attach-file

(optional) a path to a file that you’d like to attach to the issue

NewRelic

Creates a NewRelic deployment through a NewRelic Integration. Not supported in PowerShell.

Bash

Option Description

--type

the type of object to be posted. At the moment, only “deployment” is supported

--description

description of the deployment

--username

the user recording the deployment. Defaults to “JFrog Pipelines”

--changelog

the changelog value to use in the deployment

--revision

the deployment revision (required)

--appId

the ID of the app being deployed. If not provided, --appName must be present

--appName

the name of the app being deployed. If not provided, --appId must be present

--payload

path to a valid JSON file that contains a payload to use to POST the NewRelic deployment

PagerDuty Events

Sends an event through a PagerDuty Events Integration.

Bash

PowerShell

Option Description

--text

-text

The main text to display in the event on PagerDuty.

Slack

Sends a message on Slack through a Slack Integration.

Bash

PowerShell

Option Description

--payload

-payload

(optional) A path to a valid json file to act as the payload of the message. If a payload is provided, all other parameters are ignored. This payload is directly sent to Slack, so please view the Slack API documentation for information on how the payload should be formatted.

--username

-username

(optional) shows in the heading of the Slack message

--pretext

-pretext

(optional) a string that becomes the first part of the Slack message. Defaults to current date/time

--text

-text

(optional) the main text to display in the message.

--color

-color

(optional) hex string that changes the color of the status bar to the left of the Slack message.

--recipient

-recipient

(optional) the target of the message. Should start with “@” or “#” for user or channel, respectively.

--icon-url

-icon-url

(optional) the url of the icon to show next to the message

smtpCreds (email)

Sends an email through an SMTP Credentials Integration.

Bash

PowerShell

Option Description

--recipients

-recipients

one or more email addresses

--subject

-subject

(optional) add a message to the subject. Does not replace the default subject

--body

-body

(optional) specify some text to add to the body of the email. Does not replace the existing body information

--status

-status

(optional) can be set to a valid status string. By default it will be set based on the section of scrip the command is executed in.

--attachments

-attachments

(optional) a list of files to attach to the email. Combined total of all files cannot exceed 5MB

--attach-logs

-attach-logs

(optional) ‘true’ or ‘false’. Defaults to false. All available logs for the step will be attached to the email. Note that it can only attach logs that have already been created, so using this option in the onStart section, for example, would not have very detailed logs.

--show-failing-commands

-show-failing-commands

(optional) 'true’ or ‘false’. Defaults to false. The existing logs for the step will be parsed. Any failed command that is detected will be added to the body of the email, along with up to 100 preceding lines (if printed from the same command)

Environment Options

All of the above options can also be included as environment variables instead of arguments. The command line argument will have priority over the environment. Here is the full list of ENVs:

  • NOTIFY_USERNAME (--username/-username)

  • NOTIFY_PASSWORD (--password/-password)

  • NOTIFY_RECIPIENT (--recipient/-recipient)

  • NOTIFY_PRETEXT (--pretext/-pretext)

  • NOTIFY_TEXT (--text/-text)

  • NOTIFY_COLOR (--color/-color)

  • NOTIFY_ICON_URL (--icon-url/-icon-url)

  • NOTIFY_PAYLOAD (--payload/-payload)

  • NOTIFY_TYPE (--type/-type)

  • NOTIFY_PROJECT_ID (--project-id/-project-id)

  • NOTIFY_ENVIRONMENT (--environment/-environment)

  • NOTIFY_REVISION (–revision/-revision)

  • NOTIFY_SUMMARY (--summary/-summary)

  • NOTIFY_ATTACH_FILE (--attach-file/-attach-file)

  • NOTIFY_REPOSITORY (--repository/-repository)

  • NOTIFY_EMAIL (–email--email/-email)

  • NOTIFY_STATUS (--status/-status)

  • NOTIFY_VERSION (--version/-version)

  • NOTIFY_CHANGELOG (--changelog/-changelog)

  • NOTIFY_DESCRIPTION (–description--description/-description)

  • NOTIFY_ATTACHMENTS (–attachments--attachments/-attachments)

  • NOTIFY_ATTACH_LOGS (--attach-logs/-attach-logs)

  • NOTIFY_SHOW_FAILING_COMMANDS (--show-failing-commands/-show-failing-commands)

  • NOTIFY_SUBJECT (--subject/-subject)

  • NOTIFY_BODY (–body)