Skip to content
Myr

deploy

This file

Path

examples/deploy

36 lines · 1.2 KiB

Last changed by

Merge pull request #1683 from tj/release/9.xJohn Geebefore adoption02a124c

History of this file

Take it

The walk stopped after 200 commits: lines older than bdad7dc point at it.

update Readme_zh-CN.md for v5.0oGsLPbefore adoptionbdad7dc

lines 1–2why, one step back
1#!/usr/bin/env node
2

Merge pull request #1305 from tj/release/6.xTomoaki Abebefore adoptionc5a5e7b

lines 3–5why, one step back
3// const { Command } = require('commander'); // (normal include)
4const { Command } = require('../'); // include commander in git clone of commander repo5const program = new Command();

update Readme_zh-CN.md for v5.0oGsLPbefore adoptionbdad7dc

lines 6–7why, one step back
6
7program

Merge pull request #1683 from tj/release/9.xJohn Geebefore adoption02a124c

line 8why, one step back
8 .name('deploy')

update Readme_zh-CN.md for v5.0oGsLPbefore adoptionbdad7dc

line 9why, one step back
9 .version('0.0.1')

Change to safe storage of options by default, and change action parameters (#1409)John Geebefore adoptionf76bc71

line 10why, one step back
10 .option('-c, --config <path>', 'set config path', './deploy.conf');

update Readme_zh-CN.md for v5.0oGsLPbefore adoptionbdad7dc

lines 11–14why, one step back
11
12program13 .command('setup [env]')14 .description('run setup commands for all envs')

Change to safe storage of options by default, and change action parameters (#1409)John Geebefore adoptionf76bc71

lines 15–16why, one step back
15 .option('-s, --setup_mode <mode>', 'Which setup mode to use', 'normal')
16 .action((env, options) => {

update Readme_zh-CN.md for v5.0oGsLPbefore adoptionbdad7dc

line 17why, one step back
17 env = env || 'all';

Change to safe storage of options by default, and change action parameters (#1409)John Geebefore adoptionf76bc71

lines 18–19why, one step back
18 console.log('read config from %s', program.opts().config);
19 console.log('setup for %s env(s) with %s mode', env, options.setup_mode);

update Readme_zh-CN.md for v5.0oGsLPbefore adoptionbdad7dc

lines 20–22why, one step back
20 });
2122program

Change to safe storage of options by default, and change action parameters (#1409)John Geebefore adoptionf76bc71

line 23why, one step back
23 .command('exec <script>')

update Readme_zh-CN.md for v5.0oGsLPbefore adoptionbdad7dc

lines 24–25why, one step back
24 .alias('ex')
25 .description('execute the given remote cmd')

Change to safe storage of options by default, and change action parameters (#1409)John Geebefore adoptionf76bc71

lines 26–29why, one step back
26 .option('-e, --exec_mode <mode>', 'Which exec mode to use', 'fast')
27 .action((script, options) => {28 console.log('read config from %s', program.opts().config);29 console.log('exec "%s" using %s mode and config %s', script, options.exec_mode, program.opts().config);

Expand help customisation with .addHelpText (#1296)John Geebefore adoptiond26a26d

lines 30–35why, one step back
30 }).addHelpText('after', `
31Examples:32 $ deploy exec sequential33 $ deploy exec async`34 );35

update Readme_zh-CN.md for v5.0oGsLPbefore adoptionbdad7dc

line 36why, one step back
36program.parse(process.argv);