mercredi 27 janvier 2016

Set environment = 'staging' in Ember deployed with Capistrano 3

I've got a staging environment where I'd like to set a custom set of variables for deploying my Ember.js app and I'm drawing a blank on how to do it correctly. I am using the ember-cli-rails gem. According to the documentation for that:

EMBER_ENV: If set on the environment, the value of EMBER_ENV will be passed to the ember process as the value of the --environment flag.

I'm just drawing a blank on how to set it on the "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://ift.tt/1SKIxbK'
      }
    }
  };
}

if (environment === 'production') {
  ENV.apiHost = '/app-data';
  ENV.contentSecurityPolicy = contentSecurityPolicy;

Things I've tried so far:

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



Aucun commentaire:

Enregistrer un commentaire