From 1abe9918eab3817f176d6d4bc8fb54814ded560c Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Wed, 3 Feb 2016 11:55:13 -0600 Subject: [PATCH] chore(snapshot): ignore files to upload --- scripts/e2e/e2e-publish.js | 10 +++++++--- scripts/snapshot/snapshot.config.js | 4 ++-- scripts/snapshot/snapshot.task.js | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/scripts/e2e/e2e-publish.js b/scripts/e2e/e2e-publish.js index ae1e2451d6..b2148d8a5f 100644 --- a/scripts/e2e/e2e-publish.js +++ b/scripts/e2e/e2e-publish.js @@ -7,13 +7,17 @@ module.exports = function(options) { var inputDir = path.join(__dirname, '../../dist'); var uploadQueue = []; + var ignoreFiles = /(\/test\/|\/ts\/|\/q\/|\/ionic-site\/|\/docs\/|\/examples\/|\/inquirer\/|\/lodash\/|\/tooling\/|\/colors\/|\/bin\/|\.ts$|\.bin|\.map$|\.md$|\.git|\.scss$|\.yml$|\.yaml$|\.dart$|\.txt|\.npm|bower|DS_Store|LICENSE)/i; + function uploadFiles(dir, urlPath) { fs.readdir(dir, function(err, list) { list.forEach(function(file) { var url = urlPath + '/' + file - if (url.indexOf('/test/') > -1 || url.indexOf('/ionic-site/') > -1 || url.indexOf('/docs/') > -1) return; + if (ignoreFiles.test(url)) { + return; + } fs.stat(dir + '/' + file, function(err, stat) { if (stat && stat.isDirectory()) { @@ -75,7 +79,7 @@ module.exports = function(options) { function(err, httpResponse, body) { if (err) { uploadData.status = 'failed'; - console.error('Get upload failed:', err); + console.error('Get upload failed:', uploadData.url_path, err); } else { if (httpResponse.statusCode == 200) { @@ -101,7 +105,7 @@ module.exports = function(options) { setTimeout(postNextUpload, 100); if (err) { - console.error('Upload failed:', err); + console.error('Upload failed:', uploadUrl, err); uploadData.status = 'failed'; } else { diff --git a/scripts/snapshot/snapshot.config.js b/scripts/snapshot/snapshot.config.js index 29858c57cc..5a884e817d 100644 --- a/scripts/snapshot/snapshot.config.js +++ b/scripts/snapshot/snapshot.config.js @@ -9,9 +9,9 @@ exports.config = { //domain: 'localhost:8080', specs: 'dist/e2e/**/*e2e.js', - // specs: 'dist/e2e/input/**/*e2e.js', + // specs: 'dist/e2e/button/**/*e2e.js', - sleepBetweenSpecs: 350, + sleepBetweenSpecs: 380, platformDefauls: { browser: 'chrome', diff --git a/scripts/snapshot/snapshot.task.js b/scripts/snapshot/snapshot.task.js index fcf0cf750c..3d79a5908b 100644 --- a/scripts/snapshot/snapshot.task.js +++ b/scripts/snapshot/snapshot.task.js @@ -90,7 +90,7 @@ module.exports = function(gulp, argv, buildConfig) { var chars = 'abcdefghijklmnopqrstuvwxyz'; var id = chars.charAt(Math.floor(Math.random() * chars.length)); chars += '0123456789'; - while (id.length < 4) { + while (id.length < 3) { id += chars.charAt(Math.floor(Math.random() * chars.length)); } return id;