callerc1 / shipit-npm

Npm tasks for shipit.
MIT License
21 stars 13 forks source link

Using shipit-npm with Grunt fails #10

Open eps90 opened 9 years ago

eps90 commented 9 years ago

Hi, Maybe I'm doing something wrong, but I cannot find out why. I've just installed shipit-npm in my project and loaded it in Gruntfile.js by grunt.loadNpmTasks('shipit-npm'). After runninggrunt shipit:[stage] deploy` I got error in console:

Task 'npm:init' is not in your shipitfile 

Do I have to do something more than loading the module in Gruntfile? I've event tried to set options of shipit-npm under shipit.options in Gruntfile but that didn't help. I've also created a shipitfile.js with exact config as in README.md but it wasn't it too. Thanks for help!

eps90 commented 9 years ago

All right, just after posting this question I've found a way to do what I need :) For others, here's my Gruntfile.js config:

module.exports = function(grunt) {
    grunt.loadNpmTasks('grunt-shipit');
    grunt.loadNpmTasks('shipit-deploy');
    grunt.loadNpmTasks('shipit-npm');
    require('shipit-npm')(grunt.shipit);

    grunt.initConfig({
        shipit: {
            options: {
                workspace: '/tmp/local-deploy-dir',
                deployTo: '/tmp/deploy-dir',
                repositoryUrl: 'https://github.com/author/repo,
                ignores: ['.git'],
                keepReleases: 3,
                npm: {
                    remote: false,
                    installFlags: ['--production']
                }
            },
            staging: {
                servers: 'deploy@127.0.0.1'
            }
        }
    });
};

@callerc1 If you don't mind, I'll provide a pull request with README update soon.