Commit 7de27129 authored by Fabrice Gangler's avatar Fabrice Gangler 🎨
Browse files

Merge branch...

Merge branch '77-add-optional-environment-variables-maintenance_mode-and-localization_enabled-available-since-tag' into 'master'

Resolve "Add optional environment variables MAINTENANCE_MODE and LOCALIZATION_ENABLED, available since tag "2021-04-07-01""

Closes #77

See merge request !70
parents 006c5fac a572f48b
Pipeline #18155 failed with stages
in 4 minutes and 5 seconds
......@@ -230,6 +230,8 @@ Alias of `Struct[{
mailer_footer_logo_src => Optional[String[1]],
watermark_file => Optional[String[1]],
dossier_pdf_export_logo_src => Optional[String[1]],
maintenance_mode => Optional[Boolean],
localization_enabled => Optional[Boolean],
}]`
#### Parameters
......
......@@ -167,6 +167,8 @@ describe 'demarchessimplifiees' do
it { is_expected.not_to contain_file(envfile.to_s).with_content(%r{^MAILER_FOOTER_LOGO_SRC}) }
it { is_expected.not_to contain_file(envfile.to_s).with_content(%r{^WATERMARK_FILE}) }
it { is_expected.not_to contain_file(envfile.to_s).with_content(%r{^DOSSIER_PDF_EXPORT_LOGO_SRC}) }
it { is_expected.not_to contain_file(envfile.to_s).with_content(%r{^MAINTENANCE_MODE}) }
it { is_expected.not_to contain_file(envfile.to_s).with_content(%r{^LOCALIZATION_ENABLED}) }
it { is_expected.to contain_file(envfile.to_s).that_notifies('Service[puma]') }
end
......@@ -248,6 +250,8 @@ describe 'demarchessimplifiees' do
mailer_footer_logo_src: 'custom/mail_footer_logo.png',
watermark_file: 'custom/watermark.png',
dossier_pdf_export_logo_src: 'custom/pdf_export_logo.png',
maintenance_mode: true,
localization_enabled: true,
},
}
end
......@@ -325,6 +329,8 @@ describe 'demarchessimplifiees' do
it { is_expected.to contain_file(envfile.to_s).with_content(%r{^MAILER_FOOTER_LOGO_SRC="custom/mail_footer_logo.png"}) }
it { is_expected.to contain_file(envfile.to_s).with_content(%r{^WATERMARK_FILE="custom/watermark.png"}) }
it { is_expected.to contain_file(envfile.to_s).with_content(%r{^DOSSIER_PDF_EXPORT_LOGO_SRC="custom/pdf_export_logo.png"}) }
it { is_expected.to contain_file(envfile.to_s).with_content(%r{^MAINTENANCE_MODE="true"}) }
it { is_expected.to contain_file(envfile.to_s).with_content(%r{^LOCALIZATION_ENABLED="true"}) }
it { is_expected.not_to contain_file(envfile.to_s).with_content(%r{^GITHUB_CLIENT_ID}) }
it { is_expected.not_to contain_file(envfile.to_s).with_content(%r{^GITHUB_CLIENT_SECRET}) }
......
......@@ -152,3 +152,5 @@ MAX_ATTEMPTS_JOBS="<%= $demarchessimplifiees::config['max_attempts_jobs'] %>"
<% if $demarchessimplifiees::config['mailer_footer_logo_src'] { %>MAILER_FOOTER_LOGO_SRC="<%= $demarchessimplifiees::config['mailer_footer_logo_src'] %>"<% } %>
<% if $demarchessimplifiees::config['watermark_file'] { %>WATERMARK_FILE="<%= $demarchessimplifiees::config['watermark_file'] %>"<% } %>
<% if $demarchessimplifiees::config['dossier_pdf_export_logo_src'] { %>DOSSIER_PDF_EXPORT_LOGO_SRC="<%= $demarchessimplifiees::config['dossier_pdf_export_logo_src'] %>"<% } %>
<% if $demarchessimplifiees::config['maintenance_mode'] == true { %>MAINTENANCE_MODE="true"<% } %>
<% if $demarchessimplifiees::config['localization_enabled'] == true { %>LOCALIZATION_ENABLED="true"<% } %>
......@@ -81,4 +81,6 @@ type Demarchessimplifiees::Config = Struct[{
mailer_footer_logo_src => Optional[String[1]],
watermark_file => Optional[String[1]],
dossier_pdf_export_logo_src => Optional[String[1]],
maintenance_mode => Optional[Boolean],
localization_enabled => Optional[Boolean],
}]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment