Usage
The SMTP Credentials integration can be added directly to a step in the integrations
section.
The send_notification utility function can be used with a SMTP Credentials integration to send a notification message.
Example:
|
Default Environment Variables
When you add this integration to a step, a set of environment variables is automatically made available.
Environment variable | Description |
---|---|
int_<integration-name>_name | Name of the integration |
int_<integration-name>_host | Endpoint to receive the payload |
int_<integration-name>_port | Port to use to send the email |
int_<integration-name>_hostname | Identifying label for the email |
int_<integration-name>_senderEmail | Sender email address |
int_<integration-name>_username | Username for authorization to send the email |
int_<integration-name>_password | Password for authorization to send the email |
int_<integration-name>_proxy | Proxy setting for the email server |
int_<integration-name>_secure | Secure option to connect to the email server |
int_<integration-name>_ignoreTLS | TLS option to connect to the email server without using TLS |
Example
- This example uses an SMTP Credentials integration named notifySMTP.
- The send_notification utility function is used to send the
onSuccess
andonFailure
notifications. - The YAML for this example is available in this repository in the JFrog GitHub account.
pipelines: - name: smtp_pipe steps: - name: test_step_1 type: Bash configuration: integrations: - name: notifySMTP # replace with friendly name of your SMTP Credentials integration execution: onSuccess: # replace 'notifySMTP' with the name of your SMTP Credentials integration - send_notification notifySMTP --recipients "buildalerts@mycompany.com" --subject "Build Succeeded" --body "built docker image 112.32.101.173:8081/docker-local/demo:$PIPELINE_NAME.$RUN_NUMBER" onFailure: # replace 'notifySMTP' with the name of your SMTP Credentials integration - send_notification notifySMTP --recipients "buildalerts@mycompany.com" --subject "Build Failed" --body "Failed docker image 112.32.101.173:8081/docker-local/demo:$PIPELINE_NAME.$RUN_NUMBER"