Registry / communication / ember-cli-deploy-slack

ember-cli-deploy-slack

JSON →
library2.0.0jsnpmunverified

ember-cli-deploy-slack is an ember-cli-deploy plugin designed to send deployment notifications to Slack. It integrates deeply into the `ember-cli-deploy` pipeline, providing hooks to send customizable messages for various stages such as `didDeploy` and `didFail`. The current stable version is 2.0.0, which includes updated dependencies and Node.js version requirements. As an Ember CLI Deploy plugin, its release cadence is typically aligned with the broader Ember ecosystem and major dependency updates. Its key differentiator is its seamless integration with the `ember-cli-deploy` context, allowing dynamic message generation using deployment-specific data, and leveraging `node-slackr` for flexible Slack message formatting.

npm install ember-cli-deploy-slack
INSTALL
IMPORT
SIG · EMBER-CLI-DEPLOY-S
E
ember-cli-deploy-slack
communicationjavascriptv2.0.0
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

slack configuration
✓ ENV.slack = { webhookURL: '...' }
✗ import Slack from 'ember-cli-deploy-slack'
This plugin is configured via the `slack` key within your `config/deploy.js` file, not through direct ES module imports in application code. The configuration object itself serves as the primary interface to the plugin's functionality.
Custom Hook Functions
✓ ENV.slack.didDeploy = function(context) { return function(slack) { return slack.notify({ text: '...' }); } }
✗ ENV.slack.didDeploy = 'Deployment complete!'
Custom message functions for deployment hooks (e.g., `didDeploy`, `didFail`) must return a function that takes the `slack` notifier as an argument. This inner function then calls `slack.notify` to send the message, allowing access to the full deployment `context`.

Installs the plugin, configures a basic Slack webhook and custom `didDeploy` message in `config/deploy.js` with environment variable handling for the webhook URL, and demonstrates running a production deployment.

// config/deploy.js module.exports = function(deployTarget) { var ENV = { slack: { webhookURL: process.env.SLACK_WEBHOOK_URL ?? 'YOUR_SLACK_WEBHOOK_URL', // Use env var for security channel: '#deployments', username: 'EmberDeployBot', iconEmoji: ':rocket:', // Example of a custom message for successful deployments didDeploy: function(context) { return function(slack) { const projectName = context.project.name(); return slack.notify({ text: `:white_check_mark: ${projectName} deployed to ${deployTarget}!`, attachments: [ { text: `Revision: ${context.revisionData.revisionKey}` } ] }); }; } } }; if (deployTarget === 'production') { ENV.slack.channel = '#production-deploys'; } return ENV; }; // Terminal // $ ember install ember-cli-deploy-slack // $ SLACK_WEBHOOK_URL="https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX" ember deploy production
Debug
Known issues
breakingVersion 2.0.0 introduces breaking changes by updating internal dependencies and raising the minimum Node.js version requirements. Earlier Node.js versions (e.g., Node 12) are no longer supported.
fix
Ensure your Node.js environment meets the new requirements (Node.js 14, 16, 18, or >=20). Update all `ember-cli-deploy` related dependencies to their latest compatible versions to prevent conflicts.
affects: >=2.0.0
gotchaSensitive configuration values like `webhookURL` should be managed via environment variables and *not* hardcoded directly into `config/deploy.js`.
fix
Use `process.env.YOUR_ENV_VAR ?? ''` for `webhookURL` and other sensitive data within your `config/deploy.js` to prevent accidental exposure and improve security.
affects: >=0.0.1
Errors
Common errors & fixes
Slack notification failed: Invalid webhook URL
The `webhookURL` configured in `config/deploy.js` is either missing, malformed, or has been revoked in Slack.
fix
Verify the `webhookURL` in your `config/deploy.js` file (or the environment variable it reads from), ensuring it's a valid and active Slack incoming webhook URL. Check for typos or missing parts of the URL.
TypeError: slack.notify is not a function
A custom hook function (e.g., `didDeploy`, `didFail`) is not correctly returning a function that accepts `slack` as an argument before attempting to call `slack.notify`.
fix
Ensure your custom hook functions follow the pattern `function(context) { return function(slack) { /* call slack.notify here */ }; }`. The `slack` object is only available in the *inner* function.
Upgrade
Version history
2.0.0latest on npm
Audit
Dependencies
ember-cli-deployrequiredCore deployment system; this package is a plugin for it.
node-slackrrequiredUnderlying utility used for sending messages to Slack.
Agent activity
30 hits · last 30 days
node
24
OpenAI (training)
1
Resources
ember-cli-deploy-slack — npm install ember-cli-deploy-slack · libregistry