GithubHelp home page GithubHelp logo

Comments (9)

sescobb27 avatar sescobb27 commented on September 28, 2024 3

it seems that env is not properly set when issuing ember deploy production a workaround is specified in this issue #46

this worked for me

/* eslint-env node */

'use strict';

const path = require('path');

module.exports = function(env) {
  // $ ember deploy production
  // [0] = node
  // [1] = ember
  // [2] command = deploy
  // [3] target = production
  const [,, command, target] = process.argv;

  if (command && target && command === 'deploy') {
    env = target;
  }

  const isProd = env == 'production';
  const isStaging = env == 'staging';
  const envFile = (isProd || isStaging) ? `.env.deploy.${env}` : '.env';

  return {
    clientAllowedKeys: [...],
    path: path.join(__dirname, '..', envFile)
  };
};

from ember-cli-dotenv.

sumeetattree avatar sumeetattree commented on September 28, 2024

Forgot to mention that this is the behavior in 2.0.0

On the master branch path: '../.env.deploy.${env}' fails with:
[ember-cli-dotenv]: ENOENT: no such file or directory, open '../.env.deploy.development'

from ember-cli-dotenv.

xn avatar xn commented on September 28, 2024

same

from ember-cli-dotenv.

viniciussbs avatar viniciussbs commented on September 28, 2024

Any news?

from ember-cli-dotenv.

LBKinson avatar LBKinson commented on September 28, 2024

Same. Updates @fivetanley?

from ember-cli-dotenv.

viniciussbs avatar viniciussbs commented on September 28, 2024

@sescobb27 where have you put this code?

from ember-cli-dotenv.

sescobb27 avatar sescobb27 commented on September 28, 2024

@viniciussbs in config/dotenv.js

from ember-cli-dotenv.

viniciussbs avatar viniciussbs commented on September 28, 2024

Thank you, @sescobb27. I'll give it a try.

from ember-cli-dotenv.

jkeen avatar jkeen commented on September 28, 2024

Here I am in 2020 and I had this same puzzling issue. Not sure why it happened in a new ember app but didn't in another one also running dotenv 3, but this was really puzzling and surprising.

The code above helped, but it needed a small modification to support other commands from ember-cli-deploy like ember deploy:list prod, etc etc

For future confused travelers to this thread or #46

// config/dotenv.js

'use strict';
const path = require('path');

module.exports = function(env) {
  // $ ember deploy production
  // [0] = node
  // [1] = ember
  // [2] command = deploy
  // [3] target = production
  const [,, command, target] = process.argv;

  if (command && target && (command === 'deploy' || command.indexOf("deploy:") == 0)) {
    env = target;
  }

  const isProd     = (env == 'production' || env == 'prod');
  const isStaging  = env == 'staging';
  const envFile    = (isProd || isStaging) ? `.env.deploy.${env}` : '.env';

  return {
    clientAllowedKeys: [...],
    path: path.join(__dirname, '..', envFile)
  };
};

from ember-cli-dotenv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.