Skip to content
Myr

deploy

This file

Path

examples/deploy

46 lines · 1.2 KiB

Last changed by

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

History of this file

Take it

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

Merge pull request #453 from zhiyelee/masterZhiye Libefore adoptionb2aad7a

lines 1–12why, one step back
1#!/usr/bin/env node
23/**4 * Module dependencies.5 */67var program = require('../');89program10 .version('0.0.1')11 .option('-C, --chdir <path>', 'change the working directory')12 .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 13why, one step back
13 .option('-T, --no-tests', 'ignore test hook');

Merge pull request #453 from zhiyelee/masterZhiye Libefore adoptionb2aad7a

lines 14–17why, one step back
14
15program16 .command('setup [env]')17 .description('run setup commands for all envs')

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

lines 18–20why, one step back
18 .option('-s, --setup_mode [mode]', 'Which setup mode to use')
19 .action(function(env, options) {20 var mode = options.setup_mode || 'normal';

Merge pull request #453 from zhiyelee/masterZhiye Libefore adoptionb2aad7a

lines 21–28why, one step back
21 env = env || 'all';
22 console.log('setup for %s env(s) with %s mode', env, mode);23 });2425program26 .command('exec <cmd>')27 .alias('ex')28 .description('execute the given remote cmd')

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

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

Merge pull request #453 from zhiyelee/masterZhiye Libefore adoptionb2aad7a

lines 31–41why, one step back
31 console.log('exec "%s" using %s mode', cmd, options.exec_mode);
32 }).on('--help', function() {33 console.log(' Examples:');34 console.log();35 console.log(' $ deploy exec sequential');36 console.log(' $ deploy exec async');37 console.log();38 });3940program41 .command('*')

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

line 42why, one step back
42 .action(function(env) {

Merge pull request #453 from zhiyelee/masterZhiye Libefore adoptionb2aad7a

lines 43–46why, one step back
43 console.log('deploying "%s"', env);
44 });4546program.parse(process.argv);