This might be confusing, but what you want is not environments. You want deploy targets. Here's a great blog post about difference between the two: Do not confuse environment for deploy target (that URL has been trashed in a reorg/takeover of deveo.com but a snapshot exists on archive.org).
In Ember, environments are about how your code is minified, your assets are fingerprinted, enabling/disabling certain debugging features, etc. They are not about where you want to deploy your code, which API URL you want to use, or anything like that.
You might happen to have servers called test or development, but when deploying to these servers, you should always set environment to production, not test or development.
In order to support multiple servers (deploy targets), I would use env vars to do that. Something like:
DEPLOY_TARGET=development ember build --environment=production
DEPLOY_TARGET=test ember build --environment=production
DEPLOY_TARGET=staging ember build --environment=production
DEPLOY_TARGET=production ember build --environment=production
And in your ember-cli-deploy.js, you simply access the value through process.env.DEPLOY_TARGET, like this:
const deployTarget = process.env.DEPLOY_TARGET;
if (deployTarget === 'development') {
// ...
} else if (deployTarget === 'test') {
// ...
} else if (deployTarget === 'staging') {
// ...
} else if (deployTarget === 'production') {
// ...
}
I recommend using ember-cli-deploy addon to automate this process, so that you could just type ember deploy staging to create a build for staging and deploy it.
ember build --environment=developmentyou are missing=- Ember Freak