Merge branch 'master' of github.com:meteor/meteor

This commit is contained in:
David Greenspan
2012-01-28 00:10:40 -08:00
3 changed files with 22 additions and 9 deletions

View File

@@ -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);

View File

@@ -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 <site> [--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);
}
}
});

View File

@@ -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();