Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@doodle/doodle-node-cli / src / utils / setup-enviornment.js
Size: Mime:
const { NAMESPACES, DOODLE_ENVS } = require('../constants');

module.exports = envName => {
  if (envName === 'local') {
    console.log(`'local' is not a deployable namespace. Skipping.`);
  }

  if (!NAMESPACES.includes(envName)) {
    throw new TypeError(
      `envName: ${envName} is not recognized. Either correct the spelling, or add it to constants.DOODLE_ENVS`
    );
  }

  // Pluck the values from the DOODLE_ENV object
  const envValues = DOODLE_ENVS[envName];

  const { serviceBillingBase, monolithApiBase } = envValues;

  // Needed for the @doodle/billing-client
  if (serviceBillingBase) {
    process.env.SVC_BILLING_BASE_URL = serviceBillingBase;
  }

  // Needed for the @doodle/billing-client
  if (monolithApiBase) {
    process.env.MONOLITH_API_BASE_URL = monolithApiBase;
  }
};