These are chat archives for shipitjs/shipit

11th
Feb 2016
Josiah
@Josiah
Feb 11 2016 07:51

I'm trying to create a shipitfile for deployment, but it looks like things are happening out of order. I've got a fetched event which updates npm modules but the deployment continues before this is finished.

More than likely I need to create a blocking task which prevents deployments from continuing, however I'm not sure how to hook that up to the fetched event.

Anyone got any pointers?
James
@jwhitmarsh
Feb 11 2016 08:59
Here's what I did:
grunt.registerTask('npm:install', function() {
    var done = this.async();

    grunt.shipit.local('npm install', {
      cwd: grunt.shipit.config.workspace
    }).then(function() {
      grunt.shipit.emit('npm_installed');
      done();
    });
  });
that is just using grunts native async - http://gruntjs.com/creating-tasks#custom-tasks
that is called via
  grunt.shipit.on('fetched', function() {
    return grunt.task.run('npm:install');
  });
Josiah
@Josiah
Feb 11 2016 09:06
@jwhitmarsh I ended up using the shipit-npm module which seems to have the issue solved and does exactly what I need
It would help if there was some kind of example documentation on how to do this though, as I'd imagine it's a quite common use case