/* jshint node: true */

module.exports = function(deployTarget) {
  var ENV = {
    build: {},
    pipeline: {
      activateOnDeploy: true
    },
    s3: {
      accessKeyId: process.env.AWS_KEY,
      secretAccessKey: process.env.AWS_SECRET,
      filePattern: "*"
    },
    cloudfront: {
      accessKeyId: process.env.AWS_KEY,
      secretAccessKey: process.env.AWS_SECRET
    }
  };

  if (deployTarget === 'staging') {
    ENV.build.environment = 'production';
    ENV.s3.bucket = process.env.STAGING_BUCKET;
    ENV.s3.region = process.env.STAGING_REGION;
    ENV.cloudfront.distribution = process.env.STAGING_DISTRIBUTION;
  }

  if (deployTarget === 'production') {
    ENV.build.environment = 'production';
    ENV.s3.bucket = process.env.PRODUCTION_BUCKET;
    ENV.s3.region = process.env.PRODUCTION_REGION;
    ENV.cloudfront.distribution = process.env.PRODUCTION_DISTRIBUTION;
  }

  // Note: if you need to build some configuration asynchronously, you can return
  // a promise that resolves with the ENV object instead of returning the
  // ENV object synchronously.
  return ENV;
};

@@ -101,24 +101,441 @@
 pipeline: %7B%0A
+      // This setting runs the ember-cli-deploy activation hooks on every deploy%0A      // which is necessary in order to run ember-cli-deploy-cloudfront.%0A      // To disable CloudFront invalidation, remove this setting or change it to %60false%60.%0A      // To disable ember-cli-deploy-cloudfront for only a particular environment, add%0A      // %60ENV.pipeline.activateOnDeploy = false%60 to an environment conditional below.%0A
       activa

Add comment explaining the activateOnDeploy setting; resolves #1