我正在尝试使用 grunt-ssh 从我的 macbook pro 自动部署服务器。所以我想要完成这项任务是从我的私人 bitbucket 存储库中提取。
一旦我grunt deploy
在 bash 上进行部署,部署看起来还不错,但服务器中没有任何内容
这是我的 gruntfile: module.exports = function(grunt) { grunt.initConfig({ sshconfig: { notify: { host: 'mydomain.com', port: 22, username: 'root', agent: process.env.SSH_AUTH_SOCK } }, sshexec: { deploy: { command: [ 'cd notify', 'git pull origin master', 'npm install', ].join(' && '), options: { config: 'notify' } } } } );
// Load the plugin that provides "sshevexc" task
grunt.loadNpmTasks('grunt-ssh');
// Register new task, deploy
grunt.registerTask('deploy', ['sshexec:deploy'], function(err){
if(err)
return false;
grunt.log.write('Done deploying!').ok();
});
}