Skip to content

Commit

Permalink
Merge pull request arunoda#407 from SamuelBolduc/master
Browse files Browse the repository at this point in the history
Added an uploadProgressBar option to disable it
  • Loading branch information
arunoda committed May 5, 2015
2 parents 8251d7a + 4d35a82 commit ccff8a4
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ This will create two files in your Meteor Up project directory:
// Install PhantomJS on the server
"setupPhantom": true,

// Show a progress bar during the upload of the bundle to the server.
// Might cause an error in some rare cases if set to true, for instance in Shippable CI
"enableUploadProgressBar": true,

// Application name (no spaces).
"appName": "meteor",

Expand Down
4 changes: 4 additions & 0 deletions example/mup.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
// Install PhantomJS in the server
"setupPhantom": true,

// Show a progress bar during the upload of the bundle to the server.
// Might cause an error in some rare cases if set to true, for instance in Shippable CI
"enableUploadProgressBar": true,

// Application name (No spaces)
"appName": "meteor",

Expand Down
13 changes: 7 additions & 6 deletions lib/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Actions.prototype._showKadiraLink = function() {
);
}
}
}
};

Actions.prototype._executePararell = function(actionName, args) {
var self = this;
Expand Down Expand Up @@ -110,6 +110,7 @@ Actions.prototype.deploy = function() {
var deployCheckWaitTime = this.config.deployCheckWaitTime;
var appName = this.config.appName;
var appPath = this.config.app;
var enableUploadProgressBar = this.config.enableUploadProgressBar;

console.log('Building Started: ' + this.config.app);
buildApp(appPath, buildLocation, function(err) {
Expand All @@ -131,17 +132,17 @@ Actions.prototype.deploy = function() {
sessionsData,
function (sessionData, callback) {
var session = sessionData.session;
var taskListsBuilder = sessionData.taskListsBuilder
var taskListsBuilder = sessionData.taskListsBuilder;
var env = _.extend({}, self.config.env, session._serverConfig.env);
var taskList = taskListsBuilder.deploy(
bundlePath, env,
deployCheckWaitTime, appName);
deployCheckWaitTime, appName, enableUploadProgressBar);
taskList.run(session, function (summaryMap) {
callback(null, summaryMap);
});
},
whenAfterDeployed(buildLocation)
)
);
}
});
};
Expand Down Expand Up @@ -243,7 +244,7 @@ function storeLastNChars(vars, field, limit, color) {
if(vars[field].length > 1000) {
vars[field] = vars[field].substring(vars[field].length - 1000);
}
}
};
}

function whenAfterDeployed(buildLocation) {
Expand All @@ -265,5 +266,5 @@ function haveSummaryMapsErrors(summaryMaps) {
function hasSummaryMapErrors(summaryMap) {
return _.some(summaryMap, function (summary) {
return summary.error;
})
});
}
3 changes: 3 additions & 0 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ exports.read = function() {
if(typeof mupJson.appName === "undefined") {
mupJson.appName = "meteor";
}
if(typeof mupJson.enableUploadProgressBar === "undefined") {
mupJson.enableUploadProgressBar = true;
}

//validating servers
if(!mupJson.servers || mupJson.servers.length == 0) {
Expand Down
4 changes: 2 additions & 2 deletions lib/taskLists/linux.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ exports.setup = function(config) {
return taskList;
};

exports.deploy = function(bundlePath, env, deployCheckWaitTime, appName) {
exports.deploy = function(bundlePath, env, deployCheckWaitTime, appName, enableUploadProgressBar) {
var taskList = nodemiral.taskList("Deploy app '" + appName + "' (linux)");

taskList.copy('Uploading bundle', {
src: bundlePath,
dest: '/opt/' + appName + '/tmp/bundle.tar.gz',
progressBar: true
progressBar: enableUploadProgressBar
});

taskList.copy('Setting up Environment Variables', {
Expand Down

0 comments on commit ccff8a4

Please sign in to comment.