Last active
November 18, 2016 15:46
-
-
Save webuti/8e3a12fd6ae4068cb76140d22f61c4b8 to your computer and use it in GitHub Desktop.
nodejs ssh login and git pull
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* npm install simple-ssh */ | |
var SSH = require('simple-ssh'); | |
var ssh = new SSH({ | |
host: '2.2.2.2', | |
user: 'root', | |
pass : 'root' | |
}); | |
ssh.exec('cd /var/www/site.com/public_html/ && git pull', { | |
pty: true, | |
out: function(stdout) { | |
console.log(stdout); | |
} | |
}).start(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment