]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
PRs now pass travis build, because they don't execute sauce tests 1391/head
authorIskren Chernev <iskren.chernev@gmail.com>
Tue, 31 Dec 2013 20:50:34 +0000 (17:50 -0300)
committerIskren Chernev <iskren.chernev@gmail.com>
Tue, 31 Dec 2013 21:04:57 +0000 (18:04 -0300)
Gruntfile.js
tasks/check_sauce_creds.js [new file with mode: 0644]

index 607ce9048b001e3b9dcb1d2e20531a3597437c37..06890a742fb9ba8098a4a8269f8986f81de05727 100644 (file)
@@ -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 (file)
index 0000000..e8203e3
--- /dev/null
@@ -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");
+        }
+    });
+};