Ejemplo n.º 1
0
  func: function (argv) {
    var opt = require('optimist')
      .alias('password', 'P')
      .boolean('password')
      .boolean('P')
      .describe('password', 'set a password for this deployment')
      .alias('delete', 'D')
      .boolean('delete')
      .boolean('D')
      .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" +
"\n" +
"You can deploy to any available name under 'meteor.com'\n" +
"without any additional configuration, for example,\n" +
"'myapp.meteor.com'.  If you deploy to a custom domain, such as\n" +
"'myapp.mydomain.com', then you'll also need to configure your domain's\n" +
"DNS records.  See the Meteor docs for details.\n" +
"\n" +
"The --delete flag permanently removes a deployed application, including\n" +
"all of its stored data.\n" +
"\n" +
"The --password flag sets an administrative password for the domain.  Once\n" +
"set, any subsequent 'deploy', 'logs', or 'mongo' command will prompt for\n" +
"the password.  You can change the password with a second 'deploy' command."
      );

    new_argv = opt.argv;

    if (argv.help || new_argv._.length != 2) {
      process.stdout.write(opt.help());
      process.exit(1);
    }

    if (new_argv.delete) {
      deploy.delete_app(new_argv._[1]);
    } else {
      // 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);
    }
  }
Ejemplo n.º 2
0
    func: function (argv) {
      var opt = require('optimist')
            .alias('password', 'P')
            .boolean('password')
            .boolean('P')
            .describe('password', 'set a password for this deployment')
            .alias('delete', 'D')
            .boolean('delete')
            .boolean('D')
            .describe('delete', "permanently delete this deployment")
            .boolean('debug')
            .describe('debug', 'deploy in debug mode (don\'t minify, etc)')
            .boolean('tests')
            .describe('settings', 'set optional data for Meteor.settings on the server')
      //      .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] [--settings settings.json] [--debug] [--delete]\n" +
                "\n" +
                "Deploys the project in your current directory to Meteor's servers.\n" +
                "\n" +
                "You can deploy to any available name under 'meteor.com'\n" +
                "without any additional configuration, for example,\n" +
                "'myapp.meteor.com'.  If you deploy to a custom domain, such as\n" +
                "'myapp.mydomain.com', then you'll also need to configure your domain's\n" +
                "DNS records.  See the Meteor docs for details.\n" +
                "\n" +
                "The --settings flag can be used to pass deploy-specific information to\n" +
                "the application. It will be available at runtime in Meteor.settings, but only\n" +
                "on the server. The argument is the name of a file containing the JSON data\n" +
                "to use.  The settings will persist across deployments until you again specify\n" +
                "a settings file.  To unset Meteor.settings, pass an empty settings file.\n" +
                "\n" +
                "The --delete flag permanently removes a deployed application, including\n" +
                "all of its stored data.\n" +
                "\n" +
                "The --password flag sets an administrative password for the domain.  Once\n" +
                "set, any subsequent 'deploy', 'logs', or 'mongo' command will prompt for\n" +
                "the password.  You can change the password with a second 'deploy' command."
            );

      var new_argv = opt.argv;

      if (argv.help || new_argv._.length != 2) {
        process.stdout.write(opt.help());
        process.exit(1);
      }

      if (new_argv.delete) {
        deploy.delete_app(new_argv._[1]);
      } else {
        var settings = undefined;
        if (new_argv.settings)
          settings = runner.getSettings(new_argv.settings);
        // 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, settings);
      }
    }