Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .vortex/docs/content/deployment/notifications.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ For example, to restrict New Relic notifications to only `main` and `staging`:
VORTEX_NOTIFY_NEWRELIC_BRANCHES=main,staging
```

New Relic defaults to `main,master`. All other channels default to no filter.
New Relic defaults to `main,master,develop`. All other channels default to no filter.

## Message templates and tokens

Expand Down Expand Up @@ -202,7 +202,7 @@ in development or feature branch environments.
| `VORTEX_NOTIFY_NEWRELIC_CHANGELOG` | No | Description | `.env` | Deployment changelog |
| `VORTEX_NOTIFY_NEWRELIC_USER` | No | `Deployment robot` | `.env` | User performing deployment |
| `VORTEX_NOTIFY_NEWRELIC_ENDPOINT` | No | `https://api.newrelic.com/v2` | `.env` | API endpoint |
| `VORTEX_NOTIFY_NEWRELIC_BRANCHES` | No | `main,master` | `.env` | Restrict to specific branches (comma-separated) |
| `VORTEX_NOTIFY_NEWRELIC_BRANCHES` | No | `main,master,develop` | `.env` | Restrict to specific branches (comma-separated) |

### Example

Expand Down
2 changes: 1 addition & 1 deletion .vortex/docs/content/development/variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ The list below is automatically generated with [Shellvar](https://github.com/ale
| <a id="vortex_notify_newrelic_apikey"></a>`VORTEX_NOTIFY_NEWRELIC_APIKEY` | NewRelic API key, usually of type 'USER'.<br/><br/>@see https://www.vortextemplate.com/docs/deployment/notifications#new-relic | `UNDEFINED` | `ACQUIA ENVIRONMENT`, `LAGOON ENVIRONMENT` |
| <a id="vortex_notify_newrelic_appid"></a>`VORTEX_NOTIFY_NEWRELIC_APPID` | New Relic notification application ID (auto-discovered if not provided).<br/><br/>Will be discovered automatically from application name if not provided. | `UNDEFINED` | `scripts/vortex/notify-newrelic.sh` |
| <a id="vortex_notify_newrelic_app_name"></a>`VORTEX_NOTIFY_NEWRELIC_APP_NAME` | New Relic notification application name as it appears in the dashboard. | `${VORTEX_NOTIFY_NEWRELIC_PROJECT}-${VORTEX_NOTIFY_NEWRELIC_LABEL}` | `scripts/vortex/notify-newrelic.sh` |
| <a id="vortex_notify_newrelic_branches"></a>`VORTEX_NOTIFY_NEWRELIC_BRANCHES` | New Relic notification branch filter.<br/><br/>Comma-separated list of branch names. When set, New Relic notifications are only sent for deployments on the listed branches. When empty, no filtering is applied. | `main,master` | `scripts/vortex/notify-newrelic.sh` |
| <a id="vortex_notify_newrelic_branches"></a>`VORTEX_NOTIFY_NEWRELIC_BRANCHES` | New Relic notification branch filter.<br/><br/>Comma-separated list of branch names. When set, New Relic notifications are only sent for deployments on the listed branches. When empty, no filtering is applied. | `main,master,develop` | `scripts/vortex/notify-newrelic.sh` |
| <a id="vortex_notify_newrelic_changelog"></a>`VORTEX_NOTIFY_NEWRELIC_CHANGELOG` | New Relic notification deployment changelog. Defaults to the description. | `UNDEFINED` | `scripts/vortex/notify-newrelic.sh` |
| <a id="vortex_notify_newrelic_description"></a>`VORTEX_NOTIFY_NEWRELIC_DESCRIPTION` | New Relic notification deployment description template. Available tokens: %project%, %label%, %timestamp%, %environment_url%, %login_url% | `UNDEFINED` | `scripts/vortex/notify-newrelic.sh` |
| <a id="vortex_notify_newrelic_enabled"></a>`VORTEX_NOTIFY_NEWRELIC_ENABLED` | Flag to enable New Relic notifications. Set to "true" (not "`1`") in environments where New Relic is configured. | `${NEWRELIC_ENABLED}` | `scripts/vortex/notify-newrelic.sh` |
Expand Down
8 changes: 4 additions & 4 deletions .vortex/tests/bats/unit/notify-newrelic.bats
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,17 @@ load ../_helper.bash
export VORTEX_NOTIFY_NEWRELIC_ENABLED=true
export VORTEX_NOTIFY_PROJECT="testproject"
export VORTEX_NOTIFY_NEWRELIC_USER_KEY="key1234"
export VORTEX_NOTIFY_BRANCH="develop"
export VORTEX_NOTIFY_BRANCH="feature/test"
export VORTEX_NOTIFY_SHA="abc123def456"
export VORTEX_NOTIFY_LABEL="develop"
export VORTEX_NOTIFY_LABEL="feature/test"
export VORTEX_NOTIFY_ENVIRONMENT_URL="https://test.example.com"
# VORTEX_NOTIFY_NEWRELIC_BRANCHES defaults to "main,master"
# VORTEX_NOTIFY_NEWRELIC_BRANCHES defaults to "main,master,develop"

run ./scripts/vortex/notify.sh
assert_success

assert_output_contains "Started dispatching notifications."
assert_output_contains "Skipping New Relic notification for branch 'develop'."
assert_output_contains "Skipping New Relic notification for branch 'feature/test'."
assert_output_not_contains "Started New Relic notification."
assert_output_contains "Finished dispatching notifications."

Expand Down
2 changes: 1 addition & 1 deletion scripts/vortex/notify-newrelic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ VORTEX_NOTIFY_NEWRELIC_EVENT="${VORTEX_NOTIFY_NEWRELIC_EVENT:-${VORTEX_NOTIFY_EV
# Comma-separated list of branch names. When set, New Relic notifications
# are only sent for deployments on the listed branches. When empty, no
# filtering is applied.
VORTEX_NOTIFY_NEWRELIC_BRANCHES="${VORTEX_NOTIFY_NEWRELIC_BRANCHES:-main,master}"
VORTEX_NOTIFY_NEWRELIC_BRANCHES="${VORTEX_NOTIFY_NEWRELIC_BRANCHES:-main,master,develop}"

# ------------------------------------------------------------------------------

Expand Down
Loading