0
votes

I've managed to deploy a simple todo app unto AWS with S3 using this site http://emberigniter.com/deploy-ember-cli-app-amazon-s3-linux-ssh-rsync/

However, when I attempt to do this ( Deploying with SSH and Rsync ) according to the tutorial, I run into the following error:

  • gzipping **/*.{js,css,json,ico,map,xml,txt,svg,eot,ttf,woff,woff2}
  • ignoring null
  • ✔ assets/ember-user-app-d41d8cd98f00b204e9800998ecf8427e.css
  • ✔ assets/vendor-d41d8cd98f00b204e9800998ecf8427e.css
  • ✔ assets/ember-user-app-45a9825ab0116a8007bb48645b09f060.js
  • ✔ crossdomain.xml
  • ✔ robots.txt
  • ✔ assets/vendor-d008595752c8e859a04200ceb9a77874.js
  • gzipped 6 files ok | +- upload | | | +- rsync

- Uploading using rsync...

- Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

rsync: connection unexpectedly closed (0 bytes received so far) [sender]

rsync error: unexplained error (code 255) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-47/rsync/io.c(453) [sender=2.6.9]

The following is my config/deploy.js

module.exports = function(deployTarget) {
    var ENV = {
        build: {
        environment: deployTarget
    },

    's3-index': {
        accessKeyId: "<myKeyID>",
        secretAccessKey: "<mySecret>",
        bucket: "emberjsft",
        region: "ap-southeast-1",
        allowOverwrite: true
    },
    's3': {
        accessKeyId: "<myKeyID>",
        secretAccessKey: "<mySecret>",
        bucket: "emberjsft",
        region: "ap-southeast-1"
    },

    'ssh-index': {
        remoteDir: "/var/www/",
        username: "ec2-user",
        host: "ec2-<elastic-ip>.ap-southeast-1.compute.amazonaws.com",
        privateKeyFile: "/Users/imac/MY_AWS_PEMFILE.pem", 
        allowOverwrite: true
    },
    rsync: {
        dest: "/var/www/",
        username: "ec2-user",
        host: "ec2-<elastic-ip>.ap-southeast-1.compute.amazonaws.com",
        delete: false
    }
    // include other plugin configuration that applies to all deploy targets here
    };

    if (deployTarget === 'development') {
        ENV.build.environment = 'development';
    // configure other plugins for development deploy target here
    }

    if (deployTarget === 'staging') {
        ENV.build.environment = 'production';
    // configure other plugins for staging deploy target here
    }

    if (deployTarget === 'production') {
        ENV.build.environment = 'production';
    // configure other plugins for production deploy target here
    }

    // 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;
};

How should I resolve this issue?

Thanks

3

3 Answers

1
votes

I've just spent the last hour fighting the same issue as you. I was able to kind of fix it by using ssh-add /home/user/.ssh/example-key.pem and removing privateKeyFile.

I still get a error thrown after the transfer ends, but can confirm all files successfully transferred to my EC2 box despite the error..

deploy.js

module.exports = function (deployTarget) {

  var ENV = {
    build: {
      environment: deployTarget
    },
    'ssh-index': {
      remoteDir: "/var/www/",
      username: "ubuntu",
      host: "52.xx.xx.xx",
      allowOverwrite: true
    },
    rsync: {
      host: "[email protected]",
      dest: "/var/www/",
      recursive: true,
      delete: true
    }
  };

  return ENV;

};
-1
votes

In your deploy.js file you need to place your information for accessKeyId. You left "" in the place of accessKeyId. You need to put your information there. Same for secretAccessKey, acessKeyId, plus your host , you need to put your elastic-ip address.

-2
votes

myKeyID and mySecret shall be present in a .env file and then accessed here by process.env.myKeyID , process.env.mySecret

Not a good practice to hard-code the Keys in deploy.js file. Best practise would be read it using Consul