Ember CLI Deploy
Ember CLI Deploy provides a flexible, plugin-based deployment pipeline specifically designed for Ember CLI applications. It integrates directly with the Ember CLI ecosystem, allowing developers to define complex deployment strategies through a configuration-driven approach. The current stable version is 2.0.0. While not following a strict time-based release cadence, it sees regular updates for bug fixes and new features, with major versions introducing significant changes like Node.js version compatibility shifts or configuration overhauls. Its key differentiator is its deep integration with Ember CLI projects and its extensible plugin architecture, which enables deployment to various targets (e.g., S3, FastBoot, gh-pages) with custom hooks and asset handling, making it a tailored solution for Ember applications rather than a general-purpose deployment tool.
Common errors
-
Error: The `plugins` config option has been removed. Please see the v1.0.0 release notes for the new way to configure plugins.
cause Using the deprecated `plugins` array in `config/deploy.js` after upgrading to `ember-cli-deploy` v1.0.0 or later.fixRefactor your `config/deploy.js` to use the new plugin configuration syntax, specifying `disabled` or `disable` options directly within each plugin's configuration block. -
Error: Node.js v12.x is no longer supported by ember-cli-deploy.
cause Attempting to run `ember-cli-deploy` v2.0.0 or later with a Node.js 12 environment.fixUpdate your Node.js installation to version 14.*, 16.*, or any newer supported LTS release. Confirm your `package.json` engines field also reflects compatible versions. -
Error: Command `ember deploy` not found.
cause Either `ember-cli-deploy` was not installed or it was installed incorrectly (e.g., via `npm install` instead of `ember install`).fixEnsure you are in an Ember CLI project directory and run `ember install ember-cli-deploy`. If already installed, try `rm -rf node_modules yarn.lock package-lock.json && npm install` (or `yarn install`) to rebuild dependencies. -
Error: Cannot read properties of undefined (reading 'init') related to CoreObject.
cause An older version of `ember-cli-deploy` or its dependencies had compatibility issues with newer Ember/Ember CLI versions regarding `CoreObject` initialization.fixUpgrade `ember-cli-deploy` to at least version `0.6.4` to include fixes for `CoreObject` deprecations and compatibility with newer Ember CLI internals.
Warnings
- breaking Version 2.0.0 of `ember-cli-deploy` officially dropped support for Node.js 12. Projects using Node.js 12 will encounter errors or unexpected behavior.
- breaking The `plugins` config option was deprecated in v1.0.0-beta.1 and completely replaced in v1.0.0 with a new, more flexible approach for defining plugin ordering, disabling, and aliasing.
- gotcha Plugin name extraction for scoped npm packages (e.g., `@scope/ember-cli-deploy-plugin`) was bugged in versions prior to v2.0.0, potentially causing issues with plugin discovery or usage.
Install
-
npm install ember-cli-deploy -
yarn add ember-cli-deploy -
pnpm add ember-cli-deploy
Imports
- Installation
npm install ember-cli-deploy
ember install ember-cli-deploy
- Deployment Command
node_modules/.bin/ember-cli-deploy
ember deploy
- Configuration File Export
const config = { /* ... */ };module.exports = function(environment) { return { /* ... */ }; };
Quickstart
import { execSync } from 'node:child_process';
import { writeFileSync } from 'node:fs';
import { resolve } from 'node:path';
// 1. Install ember-cli-deploy (usually done in your Ember CLI project)
console.log('Installing ember-cli-deploy...');
execSync('ember install ember-cli-deploy', { stdio: 'inherit' });
// 2. Install a common deployment plugin (e.g., ember-cli-deploy-build)
console.log('Installing ember-cli-deploy-build...');
execSync('ember install ember-cli-deploy-build', { stdio: 'inherit' });
// 3. Create a basic deploy configuration file (config/deploy.js)
const deployConfigFileContent = `
module.exports = function(environment) {
let ENV = {
build: {
environment: environment
},
// Add other plugins and their configurations here
// For example, for S3 deployment:
// s3: {
// accessKeyId: process.env.AWS_ACCESS_KEY_ID ?? '',
// secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY ?? '',
// bucket: 'my-ember-app-bucket',
// region: 'us-east-1'
// }
};
return ENV;
};
`;
const configPath = resolve(process.cwd(), 'config', 'deploy.js');
writeFileSync(configPath, deployConfigFileContent);
console.log(`Created dummy config/deploy.js at ${configPath}`);
// 4. Run the deploy command (requires an actual Ember CLI project context)
console.log('To deploy, navigate to your Ember CLI project and run:');
console.log(' ember deploy --environment=production');
console.log('Make sure you have appropriate plugins installed and configured.');