首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用SSH + RSync将EmberJS部署到AWS

使用SSH + RSync将EmberJS部署到AWS
EN

Stack Overflow用户
提问于 2016-07-08 00:01:30
回答 3查看 254关注 0票数 0

我已经成功地用S3部署了一个简单的todo应用程序到AWS,使用这个站点http://emberigniter.com/deploy-ember-cli-app-amazon-s3-linux-ssh-rsync/

但是,当我根据本教程尝试执行此操作(使用SSH和Rsync进行部署)时,会遇到以下错误:

  • 压缩**/*.{js,css,json,ico,map,xml,txt,svg,eot,ttf,woff,woff2}
  • 忽视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文件,ok + +- upload upload upload

-使用rsync上传.

-权限被拒绝(公共密钥,gssapi-keyex,gssapi-with-mic).

rsync:连接意外关闭(到目前为止接收到的0字节)发送方

/BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-47/rsync/io.c(453) sender=2.6.9中的rsync错误:无法解释的错误(代码255)

下面是我的config/ployy.js

代码语言:javascript
复制
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;
};

我该如何解决这个问题呢?

谢谢

EN

回答 3

Stack Overflow用户

发布于 2016-07-11 09:19:01

我刚花了一个小时和你一样的问题。我可以通过使用ssh-add /home/user/.ssh/example-key.pem和删除privateKeyFile来修复它。

传输结束后仍会引发错误,但可以确认所有成功传输到我的EC2框的文件,尽管存在错误。

deploy.js

代码语言:javascript
复制
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: "ubuntu@52.xx.xx.xx",
      dest: "/var/www/",
      recursive: true,
      delete: true
    }
  };

  return ENV;

};
票数 1
EN

Stack Overflow用户

发布于 2016-07-08 14:33:34

在您的deploy.js文件中,您需要为accessKeyId放置您的信息。你离开了"“在accessKeyId的位置。你需要把你的信息放在那里。对于secretAccessKey、acessKeyId和主机,您也需要放置弹性ip地址。

票数 -1
EN

Stack Overflow用户

发布于 2016-07-09 07:37:27

myKeyIDmySecret将出现在.env文件中,然后由process.env.myKeyIDprocess.env.mySecret在这里访问

deploy.js文件中硬编码密钥并不是一个很好的实践。最好的做法是使用领事阅读它

票数 -2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38257087

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档