我已经成功地用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-使用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
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;
};我该如何解决这个问题呢?
谢谢
发布于 2016-07-11 09:19:01
我刚花了一个小时和你一样的问题。我可以通过使用ssh-add /home/user/.ssh/example-key.pem和删除privateKeyFile来修复它。
传输结束后仍会引发错误,但可以确认所有成功传输到我的EC2框的文件,尽管存在错误。
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: "ubuntu@52.xx.xx.xx",
dest: "/var/www/",
recursive: true,
delete: true
}
};
return ENV;
};发布于 2016-07-08 14:33:34
在您的deploy.js文件中,您需要为accessKeyId放置您的信息。你离开了"“在accessKeyId的位置。你需要把你的信息放在那里。对于secretAccessKey、acessKeyId和主机,您也需要放置弹性ip地址。
发布于 2016-07-09 07:37:27
myKeyID和mySecret将出现在.env文件中,然后由process.env.myKeyID,process.env.mySecret在这里访问
在deploy.js文件中硬编码密钥并不是一个很好的实践。最好的做法是使用领事阅读它
https://stackoverflow.com/questions/38257087
复制相似问题