1

我正在尝试使用 grunt-ssh 来部署我的应用程序。

我安装了 grunt-ssh,一切正常。

这是咕噜声:

module.exports = function(grunt){
  grunt.initConfig({
    // don't keep passwords in source control
    secret: grunt.file.readJSON('grunt/ssh.json'),
    sshexec: {
      uptime: {
        command: "uptime",
        options: {
          host: "<%= secret.host %>",
          port: 22,
          username: "<%= secret.username %>",
          password: "<%= secret.password %>",
          path: "<%= secret.path %>"
        }
      }
    },
    // our sftp file copy config
    sftp: {
      deploy: {
        files: {
          "./": "publish/**"
        },
        options: {
          srcBasePath: "publish/",
          createDirectories: true,
          showProgress: true
        }
      }
    }
  });

  grunt.loadNpmTasks('grunt-ssh');
  grunt.registerTask('deploy', [
    'sshexec:uptime',
    'sftp:deploy'
  ]);

};

在我跑步之后grunt deploy,这就是我所拥有的:

Running "sshexec:uptime" (sshexec) task
Verifying property sshexec.uptime exists in config...ERROR
>> Unable to process task.
Warning: Required config property "sshexec.uptime" missing. Use --force to continue.

Aborted due to warnings.

我受到http://tech.toptable.co.uk/blog/2013/08/08/grunt-your-deployments-too/的启发

这个实在想不通。任何想法 ?

PS:我的配置:grunt-cli v0.1.13 grunt v0.4.5

4

0 回答 0