我设法使用此网站将一个简单的todo应用程序部署到AWS的S3 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
- 权限被拒绝(publickey,gssapi-keyex,gssapi-with-mic)。
rsync:连接意外关闭(到目前为止收到0个字节)[sender]
rsync错误:/BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-47/rsync/io.c(453)[sender = 2.6。]无法解释的错误(代码255)。 9]
以下是我的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;
};
我该如何解决这个问题?
由于
答案 0 :(得分:1)
我刚刚花了最后一小时和你讨论同样的问题。我可以使用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;
};
答案 1 :(得分:-1)
在deploy.js文件中,您需要为accessKeyId提供信息。你离开了&#34;&#34;在accessKeyId的位置。你需要把你的信息放在那里。对于secretAccessKey,acessKeyId和你的主机,你需要输入你的弹性IP地址。
答案 2 :(得分:-2)
myKeyID
和mySecret
应出现在.env
文件中,然后由process.env.myKeyID
,process.env.mySecret
对deploy.js
文件中的密钥进行硬编码不是一个好习惯。
最佳做法是使用Consul