Skip to content
Myr

deploy

This file

Path

examples/deploy

37 lines · 1.2 KiB

Last changed by

Replace use of var with const and let (#1161)John Geebefore adoption3e5b05e

History of this file

Take it

1#!/usr/bin/env node23// const program = require('commander'); // (normal include)4const program = require('../'); // include commander in git clone of commander repo56program7  .version('0.0.1')8  .option('-C, --chdir <path>', 'change the working directory')9  .option('-c, --config <path>', 'set config path. defaults to ./deploy.conf')10  .option('-T, --no-tests', 'ignore test hook');1112program13  .command('setup [env]')14  .description('run setup commands for all envs')15  .option('-s, --setup_mode [mode]', 'Which setup mode to use')16  .action(function(env, options) {17    const mode = options.setup_mode || 'normal';18    env = env || 'all';19    console.log('setup for %s env(s) with %s mode', env, mode);20  });2122program23  .command('exec <cmd>')24  .alias('ex')25  .description('execute the given remote cmd')26  .option('-e, --exec_mode <mode>', 'Which exec mode to use')27  .action(function(cmd, options) {28    console.log('exec "%s" using %s mode', cmd, options.exec_mode);29  }).on('--help', function() {30    console.log('  Examples:');31    console.log();32    console.log('    $ deploy exec sequential');33    console.log('    $ deploy exec async');34    console.log();35  });3637program.parse(process.argv);