deploy
This file
Path
examples/deploy
35 lines · 1.0 KiB
Last changed by
Use standard import in examples (#2168)John Geebefore adoption41b12cf
History of this fileTake it
The walk stopped after 200 commits: lines older than 0b0fbbe point at it.
Update dependencies (#1524)John Geebefore adoption0b0fbbe
lines 1–2why, one step back1#!/usr/bin/env node2Use standard import in examples (#2168)John Geebefore adoption41b12cf
line 3why, one step back3const { Command } = require('commander');Update dependencies (#1524)John Geebefore adoption0b0fbbe
lines 4–6why, one step back4const program = new Command();56programMerge pull request #1683 from tj/release/9.xJohn Geebefore adoption02a124c
line 7why, one step back7 .name('deploy')Update dependencies (#1524)John Geebefore adoption0b0fbbe
lines 8–35why, one step back8 .version('0.0.1')9 .option('-c, --config <path>', 'set config path', './deploy.conf');1011program12 .command('setup [env]')13 .description('run setup commands for all envs')14 .option('-s, --setup_mode <mode>', 'Which setup mode to use', 'normal')15 .action((env, options) => {16 env = env || 'all';17 console.log('read config from %s', program.opts().config);18 console.log('setup for %s env(s) with %s mode', env, options.setup_mode);19 });2021program22 .command('exec <script>')23 .alias('ex')24 .description('execute the given remote cmd')25 .option('-e, --exec_mode <mode>', 'Which exec mode to use', 'fast')26 .action((script, options) => {27 console.log('read config from %s', program.opts().config);28 console.log('exec "%s" using %s mode and config %s', script, options.exec_mode, program.opts().config);29 }).addHelpText('after', `30Examples:31 $ deploy exec sequential32 $ deploy exec async`33 );34 35program.parse(process.argv);