Skip to content

Instantly share code, notes, and snippets.

@gnarf
Created September 12, 2012 13:56
Show Gist options
  • Save gnarf/492f5a995697047e9cf0 to your computer and use it in GitHub Desktop.
Save gnarf/492f5a995697047e9cf0 to your computer and use it in GitHub Desktop.
var botio = require( process.env.BOTIO_MODULE ),
cmdqueue = [];
require('shelljs/global');
function next() {
var fn = cmdqueue.shift();
if ( fn ) {
fn();
}
}
function queue( cmd, callback ) {
function cb( error, data ) {
if ( callback ) {
callback( error, data );
}
if (error) {
botio.message( "## Failed running:");
botio.message( "```shell" );
botio.message( cmd );
botio.message( "```" );
process.exit( 1 );
} else {
next();
}
}
cmdqueue.push( function() {
exec( cmd, { async: true, silent: false }, cb );
});
}
queue( "npm install -q --color false" );
queue( "grunt --no-color" );
queue( "/usr/local/bin/tools/jenkins-testswarm-static-copy.sh jquery " + botio.head_sha );
queue( "grunt --no-color testswarm:" + botio.head_sha + ":/usr/local/bin/tools/node-testswarm-config.json", function( error, output ) {
var submittedMatch = output.match( /Submited job (\d+) (http:\/\/swarm.jquery.org\/job\/\d+)/ );
if (submittedMatch) {
botio.message("## Swarm URL: " + submittedMatch[2]);
}
});
next();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment