UNPKG

briareus

Version:

Briareus assists with Feature Branch deploys to ECS

40 lines (30 loc) 891 B
'use strict' const path = require('path'); const { PassThrough } = require('stream'); const AWS = require('aws-sdk'); const async = require('async'); const _ = require('lodash'); const objectPath = require("object-path"); const commands = require('./commands'); const Briareus = function() { if (!(this instanceof Briareus)) { return new Briareus(); } if (!AWS.config.region) { AWS.config.update({ region: process.env.AWS_DEFAULT_REGION || 'us-east-1' }); } // Map command run methods to export object _.each(commands, (cmd, key) => this[key] = function(options, cb) { _.defaults({ output: new PassThrough() }); cmd.run.bind(this).apply(options, cb); }); return this; } Briareus.prototype.cliSetup = function(yargs, output, cb) { _.each(commands, (cmd, key) => cmd.setup(this, yargs, output, cb) ); } module.exports = Briareus;