Skip to content
Myr

deploy

This file

Path

examples/deploy

38 lines · 1.2 KiB

Last changed by

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

History of this file

Take it

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

chmod 644 travis.ymlabetomobefore adoptionaf17996

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();

chmod 644 travis.ymlabetomobefore adoptionaf17996

lines 6–10why, one step back
6
7program8 .version('0.0.1')9 .option('-C, --chdir <path>', 'change the working directory')10 .option('-c, --config <path>', 'set config path. defaults to ./deploy.conf')

Examples: use "require" that works from git repo, and lint. (#1072)John Geebefore adoption57e9d98

line 11why, one step back
11 .option('-T, --no-tests', 'ignore test hook');

chmod 644 travis.ymlabetomobefore adoptionaf17996

lines 12–15why, one step back
12
13program14 .command('setup [env]')15 .description('run setup commands for all envs')

Examples: use "require" that works from git repo, and lint. (#1072)John Geebefore adoption57e9d98

lines 16–17why, one step back
16 .option('-s, --setup_mode [mode]', 'Which setup mode to use')
17 .action(function(env, options) {

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

line 18why, one step back
18 const mode = options.setup_mode || 'normal';

chmod 644 travis.ymlabetomobefore adoptionaf17996

lines 19–26why, one step back
19 env = env || 'all';
20 console.log('setup for %s env(s) with %s mode', env, mode);21 });2223program24 .command('exec <cmd>')25 .alias('ex')26 .description('execute the given remote cmd')

Examples: use "require" that works from git repo, and lint. (#1072)John Geebefore adoption57e9d98

lines 27–28why, one step back
27 .option('-e, --exec_mode <mode>', 'Which exec mode to use')
28 .action(function(cmd, options) {

chmod 644 travis.ymlabetomobefore adoptionaf17996

lines 29–38why, one step back
29 console.log('exec "%s" using %s mode', cmd, options.exec_mode);
30 }).on('--help', function() {31 console.log(' Examples:');32 console.log();33 console.log(' $ deploy exec sequential');34 console.log(' $ deploy exec async');35 console.log();36 });3738program.parse(process.argv);