linemanjs / lineman

Lineman helps you build fat-client JavaScript apps. It produces happiness by building assets, mocking servers, running specs on every file change
MIT License
1.18k stars 83 forks source link

Is it cool to use internal grunt tasks? #252

Closed neall closed 10 years ago

neall commented 10 years ago

I'm making a deploy grunt task. I made a task called scp_files to do the actual deploy, and right now my deploy task is defined like this:

grunt.registerTask('deploy', ['dist', 'scp_files']);

The dist task seems to be doing the same thing that running lineman build would do, which is nice.

On my CI machine I want to run the tests and then automatically deploy to my beta server if the tests pass.

Is there a task I can run that runs the headless tests? Should I even be relying on these tasks that Lineman defines for its own use? I would like to define a task something like this:

grunt.registerTask('ci_deploy', ['dist', '??????', 'scp_files']);

If using the internally-defined grunt tasks isn't kosher, I can always go back to running build, spec-ci, grunt deploy sequentially in a shell script.

davemo commented 10 years ago

you should be able to drop spec-ci into your workflow:

grunt.registerTask('ci_deploy', ['dist', 'spec-ci', 'scp_files']);

davemo commented 10 years ago

As for whether it's kosher, we don't have any predetermined methods of consuming the internal tasks that lineman uses; given they are exposed and part of the grunt config object I think it's entirely appropriate to use them in your own task definitions :)

neall commented 10 years ago

Thanks. I also threw 'clean' and 'common' on before 'dist' after looking at what lineman build does.