detect staging env

This commit is contained in:
Christophe Robillard 2021-03-24 15:05:24 +01:00
parent db7603efb7
commit 83cf0fa903
4 changed files with 6 additions and 8 deletions

View file

@ -110,7 +110,7 @@ module ApplicationHelper
end
def staging?
ENV['APP_NAME'] == 'tps_dev'
Rails.application.config.ds_env == 'staging'
end
def contact_link(title, options = {})

View file

@ -73,7 +73,9 @@ module TPS
config.middleware.use Rack::Attack
config.middleware.use Flipper::Middleware::Memoizer, preload_all: true
config.ds_weekly_overview = ENV['APP_NAME'] == 'tps'
config.ds_env = ENV.fetch('DS_ENV', Rails.env)
config.ds_weekly_overview = Rails.env.production? && config.ds_env != 'staging'
config.ds_autosave = {
debounce_delay: 3000,

View file

@ -1,9 +1,3 @@
# 3 valeurs:
# * tps: environnement de production
# * tps_dev: environnement de pre-production
# * tps_local: machine de développeur
APP_NAME="tps_local"
# Nom d'hôte de l'appli
# * Pour du dev local: localhost:3000
# * pour de la preprod: preprod.ds.organisme.fr (par exemple)

View file

@ -6,6 +6,8 @@ APPLICATION_NAME="demarches-simplifiees.fr"
APPLICATION_SHORTNAME="d-s.fr"
APPLICATION_BASE_URL="https://www.demarches-simplifiees.fr"
DS_ENV="staging"
# Utilisation de France Connect
# FRANCE_CONNECT_ENABLED="disabled" # "enabled" par défaut