如何在nodeplan自动部署脚本中为nodejs应用程序添加pem文件

时间:2015-04-27 07:31:12

标签: node.js automated-deployment

我是节点应用程序部署的新手,我使用flightplan.js进行自动部署,但是在大多数文档中我看到它只是关于密码少的部署,其中用户的密钥被添加到服务器,我想设置我可以指定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
  }
]);

1 个答案:

答案 0 :(得分:8)

你可以像这样添加你的pem文件,

plan.target('staging', [
  {
    host: 'xxx.xxx.xxx',
    username: username,
    privateKey: 'path/to/file/key.pem',
    agent: process.env.SSH_AUTH_SOCK
  }
]);
相关问题