From 118a217fde87cd68b35005b5d768b7c00be09489 Mon Sep 17 00:00:00 2001 From: Nick Martin Date: Fri, 27 Jan 2012 23:37:37 -0800 Subject: [PATCH 1/2] Comment on bad side-effect of process.exit. --- app/meteor/run.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/meteor/run.js b/app/meteor/run.js index 0bde8a7ad1..fe84084bd2 100644 --- a/app/meteor/run.js +++ b/app/meteor/run.js @@ -557,6 +557,11 @@ exports.run = function (app_dir, bundle_opts, port) { if (!deps_info) { // We don't know what files to watch for changes, so we have to exit. process.stdout.write("\nPlease fix the problem and restart.\n"); + + // XXX calling process.exit like this leaves mongod running! + // One solution would be to try to kill mongo in this case. Or + // we could try to bundle before we launch mongo, so in this case + // mongo would never have been started. process.exit(1); } start_watching(); From c616e4fb8b19401844a2625c652119d4229ac2be Mon Sep 17 00:00:00 2001 From: Geoff Schmidt Date: Sat, 28 Jan 2012 00:08:11 -0800 Subject: [PATCH 2/2] deploy --tests --- app/meteor/deploy.js | 15 +++++++++------ app/meteor/meteor.js | 11 ++++++++--- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/app/meteor/deploy.js b/app/meteor/deploy.js index 79f9db7759..c54567ed8f 100644 --- a/app/meteor/deploy.js +++ b/app/meteor/deploy.js @@ -40,7 +40,8 @@ var meteor_rpc = function (rpc_name, method, site, query_params, callback) { return r; } -var deploy_app = function (url, app_dir, opt_debug, opt_set_password) { +var deploy_app = function (url, app_dir, opt_debug, opt_tests, + opt_set_password) { var parsed_url = parse_url(url); // a bit contorted here to make sure we ask for the password before @@ -49,19 +50,21 @@ var deploy_app = function (url, app_dir, opt_debug, opt_set_password) { with_password(parsed_url.hostname, function (password) { if (opt_set_password) get_new_password(function (set_password) { - bundle_and_deploy(parsed_url.hostname, app_dir, opt_debug, + bundle_and_deploy(parsed_url.hostname, app_dir, opt_debug, opt_tests, password, set_password); }); else - bundle_and_deploy(parsed_url.hostname, app_dir, opt_debug, password); + bundle_and_deploy(parsed_url.hostname, app_dir, opt_debug, opt_tests, + password); }); }; -var bundle_and_deploy = function (site, app_dir, opt_debug, password, - set_password) { +var bundle_and_deploy = function (site, app_dir, opt_debug, opt_tests, + password, set_password) { var build_dir = path.join(app_dir, '.meteor/local/build_tar'); var bundle_path = path.join(build_dir, 'bundle'); - var bundle_opts = { skip_dev_bundle: true, no_minify: !!opt_debug }; + var bundle_opts = { skip_dev_bundle: true, no_minify: !!opt_debug, + include_tests: opt_tests }; process.stdout.write('Deploying to ' + site + '. Bundling ... '); require('../lib/bundler.js').bundle(app_dir, bundle_path, bundle_opts); diff --git a/app/meteor/meteor.js b/app/meteor/meteor.js index dda978429e..9d547151da 100644 --- a/app/meteor/meteor.js +++ b/app/meteor/meteor.js @@ -445,7 +445,11 @@ Commands.push({ .describe('delete', "permanently delete this deployment") .boolean('debug') .describe('debug', 'deploy in debug mode (don\'t minify, etc)') + .boolean('tests') +// .describe('tests', 'deploy the tests instead of the actual application') .usage( + // XXX document --tests in the future, once we publicly + // support tests "Usage: meteor deploy [--password] [--delete] [--debug]\n" + "\n" + "Deploys the project in your current directory to Meteor's servers.\n" + @@ -474,9 +478,10 @@ Commands.push({ if (new_argv.delete) { deploy.delete_app(new_argv._[1]); } else { - var app_dir = path.resolve(require_project("bundle")); - deploy.deploy_app(new_argv._[1], app_dir, new_argv.debug, - new_argv.password); + // accept packages iff we're deploying tests + var project_dir = path.resolve(require_project("bundle", new_argv.tests)); + deploy.deploy_app(new_argv._[1], project_dir, new_argv.debug, + new_argv.tests, new_argv.password); } } });