/* jshint node: true */

module.exports = function(deployTarget) {
  var ENV = {
    build: {
      environment: deployTarget
    },
    'revision-data': {
      type: 'version-commit'
    },
    slack: {
      webhookURL: process.env.SLACK_WEB_HOOK_URL,
      channel: '#ember-twiddle',
      username: 'ember-twiddle-deploy-notifications',
      didDeploy: function(context) {
        var deployMessage = this._getHumanDeployMessage(context);
        return function(slack) {
          return slack.notify({
            text: deployMessage
          });
        };
      },
      _getHumanDeployMessage: function(context) {
        var revision;
        if (context.revisionData) {
          revision = context.revisionData['revisionKey'] || context.revisionData['activatedRevisionKey'];
        }

        var projectName = context.project.name();

        var message;
        if (revision) {
          message = projectName + ' revision ' + revision;
        } else {
          message = projectName;
        }

        return message + " to " + context.deployTarget + " target";
      }
    }
  };

  if (deployTarget === 'staging') {
    ENV['s3'] = {
      accessKeyId: process.env['AWS_ACCESS_KEY_ID'],
      secretAccessKey: process.env['AWS_ACCESS_KEY_SECRET'],
      bucket: "canary-assets.ember-twiddle.com",
      region: "us-west-2"
    };
    ENV['s3-index'] = {
      accessKeyId: process.env['AWS_ACCESS_KEY_ID'],
      secretAccessKey: process.env['AWS_ACCESS_KEY_SECRET'],
      bucket: "canary.ember-twiddle.com",
      region: "us-west-2"
    };
  }

  if (deployTarget === 'production') {
    ENV['s3'] = {
      accessKeyId: process.env['AWS_ACCESS_KEY_ID'],
      secretAccessKey: process.env['AWS_ACCESS_KEY_SECRET'],
      bucket: "assets.ember-twiddle.com",
      region: "us-west-2"
    };
    ENV['s3-index'] = {
      accessKeyId: process.env['AWS_ACCESS_KEY_ID'],
      secretAccessKey: process.env['AWS_ACCESS_KEY_SECRET'],
      bucket: "ember-twiddle.com",
      region: "us-west-2"
    };
  }

  return ENV;
};

@@ -404,13 +404,8 @@
 e = 
-this.
 _get
@@ -559,526 +559,8 @@
  %7D;%0A
-      %7D,%0A      _getHumanDeployMessage: function(context) %7B%0A        var revision;%0A        if (context.revisionData) %7B%0A          revision = context.revisionData%5B'revisionKey'%5D %7C%7C context.revisionData%5B'activatedRevisionKey'%5D;%0A        %7D%0A%0A        var projectName = context.project.name();%0A%0A        var message;%0A        if (revision) %7B%0A          message = projectName + ' revision ' + revision;%0A        %7D else %7B%0A          message = projectName;%0A        %7D%0A%0A        return message + %22 to %22 + context.deployTarget + %22 target%22;%0A
     
@@ -1517,8 +1517,442 @@
 ENV;%0A%7D;%0A
+%0A%0Afunction _getHumanDeployMessage(context) %7B%0A  var revision;%0A  if (context.revisionData) %7B%0A    revision = context.revisionData%5B'revisionKey'%5D %7C%7C context.revisionData%5B'activatedRevisionKey'%5D;%0A  %7D%0A%0A  var projectName = context.project.name();%0A%0A  var message;%0A  if (revision) %7B%0A    message = projectName + ' revision ' + revision;%0A  %7D else %7B%0A    message = projectName;%0A  %7D%0A%0A  return message + %22 to %22 + context.deployTarget + %22 target%22;%0A%7D%0A

fix deploy.js