Skip to content

Instantly share code, notes, and snippets.

@BradEstey
Last active May 24, 2016 15:27
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save BradEstey/8703541 to your computer and use it in GitHub Desktop.
Save BradEstey/8703541 to your computer and use it in GitHub Desktop.
Gulp Task to run PHPUnit from a Vagrant VM
var gulp = require('gulp'),
sys = require('sys'),
ssh2 = require('ssh2');
gulp.task('phpunit', function() {
var ssh = new ssh2();
ssh.on('ready', function () {
ssh.exec('cd /vagrant; phpunit', {}, function (err, stream) {
stream.on('data', function (data, extended) {
sys.puts(data);
});
stream.on('end', function () {
ssh.end();
});
});
});
ssh.connect({
host: '127.0.0.1',
port: 2222,
username: 'vagrant',
password: 'vagrant'
});
});
gulp.task('default', function() {
gulp.watch('app/**/*.php', { debounceDelay: 2000 }, ['phpunit']);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment