deploy
This file
Path
examples/deploy
43 lines · 1.1 KiB
Last changed by
Reformat code with Prettier (#2180)John Geebefore adoption1bdc749
History of this fileTake it
The walk stopped after 200 commits: lines older than 3103c6b point at it.
Add more tests for implies (#1730)John Geebefore adoption3103c6b
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');Add more tests for implies (#1730)John Geebefore adoption3103c6b
lines 4–27why, one step back4const program = new Command();56program7 .name('deploy')8 .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);Reformat code with Prettier (#2180)John Geebefore adoption1bdc749
lines 28–37why, one step back28 console.log(29 'exec "%s" using %s mode and config %s',30 script,31 options.exec_mode,32 program.opts().config,33 );34 })35 .addHelpText(36 'after',37 `Add more tests for implies (#1730)John Geebefore adoption3103c6b
lines 38–39why, one step back38Examples:39 $ deploy exec sequentialReformat code with Prettier (#2180)John Geebefore adoption1bdc749
line 40why, one step back40 $ deploy exec async`,Add more tests for implies (#1730)John Geebefore adoption3103c6b
line 41why, one step back41 );Reformat code with Prettier (#2180)John Geebefore adoption1bdc749
line 42why, one step back42Add more tests for implies (#1730)John Geebefore adoption3103c6b
line 43why, one step back43program.parse(process.argv);