From: Iskren Chernev Date: Tue, 31 Dec 2013 20:50:34 +0000 (-0300) Subject: PRs now pass travis build, because they don't execute sauce tests X-Git-Tag: 2.5.1~14^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32c1c3448a2a42eec619ae918dea9eedfdec91f9;p=thirdparty%2Fmoment.git PRs now pass travis build, because they don't execute sauce tests --- diff --git a/Gruntfile.js b/Gruntfile.js index 607ce9048..06890a742 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -204,7 +204,8 @@ module.exports = function (grunt) { // travis build task grunt.registerTask('build:travis', [ - 'jshint', 'test:node', 'test:travis-sauce-browser' + 'jshint', 'test:node', 'check-sauce-creds', + 'test:travis-sauce-browser' ]); // Task to be run when releasing a new version diff --git a/tasks/check_sauce_creds.js b/tasks/check_sauce_creds.js new file mode 100644 index 000000000..e8203e3dc --- /dev/null +++ b/tasks/check_sauce_creds.js @@ -0,0 +1,14 @@ +module.exports = function (grunt) { + + // Pull Requests do not have secure variables enabled for security reasons. + // Use this task before launching travis-sauce-browser task, so it would + // exit early and won't try connecting to saucelabs without credentials. + grunt.registerTask('check-sauce-creds', function () { + if (process.env.SAUCE_USERNAME === undefined) { + grunt.log.writeln("No sauce credentials found"); + grunt.task.clearQueue(); + } else { + grunt.log.writeln("Sauce credentials found"); + } + }); +};