Skip to content

Instantly share code, notes, and snippets.

@narenaryan
Last active May 2, 2017 07:29
Show Gist options
  • Select an option

  • Save narenaryan/37f164a1105f417ace5047cd2995fdb9 to your computer and use it in GitHub Desktop.

Select an option

Save narenaryan/37f164a1105f417ace5047cd2995fdb9 to your computer and use it in GitHub Desktop.
gulpfile.js
var gulp = require("gulp");
var shell = require('gulp-shell');
// This compiles new binary with source change
gulp.task("install-binary", shell.task([
'go install github.com/narenaryan/myserver'
]));
// Second argument tells install-binary is a deapendency for restart-supervisor
gulp.task("restart-supervisor", ["install-binary"], shell.task([
'supervisorctl restart myserver'
]))
gulp.task('watch', function() {
// Watch the source code for all changes
gulp.watch("*", ['install-binary', 'restart-supervisor']);
});
gulp.task('default', ['watch']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment