grunt-travis-matrix
v1.0.0
Published
Run matrix-specific scripts during travis builds
Downloads
15
Maintainers
Readme
grunt-travis-matrix
Run matrix-specific grunt tasks on travis
Getting Started
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-travis-matrix --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-travis-matrix');
Alternatively, install task-master and let it manage this for you.
The "travisMatrix" task
One problem I've run into using travis is that there is currently no way to tell it to run certain scripts only for certain matrix combinations (e.g. only on node v0.10). This task is designed to do that for you.
Overview
In your project's Gruntfile, add a section named travisMatrix
to the data object passed into grunt.initConfig()
. Each target should have a test
property and a tasks
property. The test property is a simple function that returns true or false. If it returns true, the tasks inside the tasks
property will be queued to run.
grunt.initConfig({
travisMatrix: {
v4: {
test: function() {
return /^v4/.test(process.version);
},
tasks: ['foo', 'bar']
}
}
});
This task can pair well with an arbitrary shell task wrapper like grunt-exec.
Contributing
Please see the contribution guidelines.