ruby on rails - Set environment = 'staging' in Ember deployed with Capistrano 3 -


i've got staging environment i'd set custom set of variables deploying ember.js app , i'm drawing blank on how correctly. using ember-cli-rails gem. according documentation that:

ember_env: if set on environment, value of ember_env passed ember process value of --environment flag.

i'm drawing blank on how set on "environment".

/project/frontend/config/environment.js

if (environment === 'test') {   // testem prefers this...   env.baseurl = '/';   env.locationtype = 'none';    // keep test console output quieter   env.app.log_active_generation = false;   env.app.log_view_lookups = false;    env.app.rootelement = '#ember-testing'; }  if (environment === 'staging') {   env.apihost = '/app-data';   env.contentsecuritypolicy = contentsecuritypolicy;   env.torii = {     providers: {       'my-custom-oauth2': {         apikey: '1234123412341234123412341234',         baseurl: 'http://www.server.com:9108/oauth/authorize'       }     }   }; }  if (environment === 'production') {   env.apihost = '/app-data';   env.contentsecuritypolicy = contentsecuritypolicy; 

things i've tried far:

  • setting export ember_env='staging' in deployer user's .profile
  • setting set :default_env, { 'ember_env' => 'staging' } in /config/deploy/staging.rb file.

unfortunately, ember cli support test, development , production valid environments

the env object contains 3 important keys:

  • emberenv can used define ember feature flags (see feature flags guide).
  • app can used pass flags/options application instance.
  • environment contains name of current environment (development, production or test).

there several unofficial solutions out there, of them use ember-cli-deploy , change settings based on deploytarget value. others use dotenv manage each environment settings.

we're dealing @ moment , couldn't find solution feels right.


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -