简体   繁体   中英

Unable to use grunt-ssh to do tasks on server

i am trying to use grunt-ssh to automate deployment of server from my macbook pro. So what i am trying to do with this task is to pull from my private bitbucket depository.

Deployment is looks okay once i do grunt deploy on bash but nothing gets pulled in server

This is my 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();
    });
}

Try adding in your sshconfig:

agentForward: true

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM