我是 Node 应用程序部署的新手,我正在使用 flightplan.js 进行自动部署,但是在我看到的大多数文档中,它只是关于将用户 key 添加到服务器的无密码部署,我想设置向上我可以指定 pem 文件位置的目标以便登录到服务器,有没有办法做到这一点?现在目标看起来像这样
plan.target('staging', [
{
host: 'xxx.xxx.xxx',
username: username,
agent: process.env.SSH_AUTH_SOCK
}
]);
我也想要一些可以传递 pem 文件路径的东西,像这样
plan.target('staging', [
{
host: 'xxx.xxx.xxx',
username: username,
key: PATH_TO_KEY
agent: process.env.SSH_AUTH_SOCK
}
]);
最佳答案
您可以像这样添加您的 pem 文件,
plan.target('staging', [
{
host: 'xxx.xxx.xxx',
username: username,
privateKey: 'path/to/file/key.pem',
agent: process.env.SSH_AUTH_SOCK
}
]);
关于node.js - 如何在 nodejs 应用程序的 flightplan 自动部署脚本中将 pem 文件添加到目标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29889722/