lib/models/pipeline.js
function Pipeline(hookNames, options) {
  hookNames = hookNames || [];
  options = options || {};
  options = _.merge({
    ui: {
      logInfoColor: 'blue',
      logErrorColor: 'red'
    }
  }, options);

  this._ui = options.ui;

  this._pipelineHooks = hookNames.reduce(function(pipelineHooks, hookName) {
    pipelineHooks[hookName] = [];

    return pipelineHooks;
  }, { didFail: [] });

  this.logInfo = chalk[this._ui.logInfoColor];
  this.logError = chalk[this._ui.logErrorColor];
  this._progressBarLib = options.progressBarLib || require('react-deploy-progress');
}
function Pipeline(hookNames, options) {
  hookNames = hookNames || [];
  options = options || {};
  options = _.merge({
    ui: {
      logInfoColor: 'blue',
      logErrorColor: 'red'
    }
  }, options);

  this._ui = options.ui;

  this._pipelineHooks = hookNames.reduce(function(pipelineHooks, hookName) {
    pipelineHooks[hookName] = [];

    return pipelineHooks;
  }, { didFail: [] });

  this.logInfo = chalk[this._ui.logInfoColor];
  this.logError = chalk[this._ui.logErrorColor];
  this._progressBarLib = options.progressBarLib || require('react-deploy-progress');
}
/* This is a generic implementation of a pipeline with ordered, promise-aware hooks,
pleasant logging, and failure handling. It should not have any "deployment" domain
logic or semantics, and is a candidate for extraction to its own npm module.