diff --git a/deploy/definitions/opsworks_deploy.rb b/deploy/definitions/opsworks_deploy.rb index ceb170ae76..41de37e861 100644 --- a/deploy/definitions/opsworks_deploy.rb +++ b/deploy/definitions/opsworks_deploy.rb @@ -64,6 +64,7 @@ # setup deployment & checkout if deploy[:scm] && deploy[:scm][:scm_type] != 'other' Chef::Log.debug("Checking out source code of application #{application} with type #{deploy[:application_type]}") + Chef::Log.debug("Migration control variables: running #{deploy[:migrate_command]} with env #{deploy[:environment]} and rails_env #{deploy[:rails_env]}") deploy deploy[:deploy_to] do provider Chef::Provider::Deploy.const_get(deploy[:chef_provider]) keep_releases deploy[:keep_releases] diff --git a/deploy/recipes/hurricane-api.rb b/deploy/recipes/hurricane-api.rb index f3073f5175..d42a9f23d2 100644 --- a/deploy/recipes/hurricane-api.rb +++ b/deploy/recipes/hurricane-api.rb @@ -55,7 +55,8 @@ owner deploy[:user] group deploy[:group] variables( - :hurricane_api_settings => node[:hurricane_api_settings] + :hurricane_api_settings => node[:hurricane_api_settings], + :env => rails_env ) only_if do File.exists?("#{deploy[:deploy_to]}/shared/config") @@ -104,6 +105,20 @@ end end + template "#{deploy[:deploy_to]}/shared/config/rca.yml" do + source 'hurricane-api/rca.yml.erb' + mode '0660' + owner deploy[:user] + group deploy[:group] + variables( + :companies_enabled => node[:hurricane_api_settings][:rca][:offers_search][:companies_enabled] || [], + :env => rails_env + ) + only_if do + File.exists?("#{deploy[:deploy_to]}/shared/config") + end + end + template "#{deploy[:deploy_to]}/shared/config/air_api.yml" do source 'hurricane-api/air_api.yml.erb' mode '0660' diff --git a/deploy/recipes/hurricane-copy-from-production-db.rb b/deploy/recipes/hurricane-copy-from-production-db.rb index 868c9f12c6..3d3bafcaac 100644 --- a/deploy/recipes/hurricane-copy-from-production-db.rb +++ b/deploy/recipes/hurricane-copy-from-production-db.rb @@ -5,7 +5,7 @@ production_database = node[:hurricane_api_settings][:production_database] - if deploy[:rails_env] == 'staging' + if deploy[:rails_env] == 'staging' || deploy[:rails_env] == 'preprod' dump_dir = "#{deploy[:deploy_to]}/shared/dump" @@ -164,7 +164,7 @@ end else - Chef::Log.debug('Recipe available only in staging environment') + Chef::Log.debug('Recipe available only in staging/preprod environment') end end diff --git a/deploy/recipes/hurricane-print.rb b/deploy/recipes/hurricane-print.rb index e2adcfd563..ac910bb307 100644 --- a/deploy/recipes/hurricane-print.rb +++ b/deploy/recipes/hurricane-print.rb @@ -3,6 +3,10 @@ node[:deploy].each do |application, deploy| + execute 'hostname "'+node["opsworks"]["instance"]["public_dns_name"]+'"' do + not_if 'hostname -eq "'+node["opsworks"]["instance"]["public_dns_name"]+'"' + end + rails_env = deploy[:rails_env] current_path = deploy[:current_path] diff --git a/deploy/templates/default/hurricane-api/aviva.yml.erb b/deploy/templates/default/hurricane-api/aviva.yml.erb index 3869a08fe7..84cdf55bb7 100644 --- a/deploy/templates/default/hurricane-api/aviva.yml.erb +++ b/deploy/templates/default/hurricane-api/aviva.yml.erb @@ -13,7 +13,7 @@ pdf: storages: s3: - bucket_name: 'fit2you-rca-<%= @env %>' + bucket_name: '<%= @hurricane_api_settings[:aviva_rca][:bucket_name] %>' folder: 'aviva' codice: convenzione: '00980' diff --git a/deploy/templates/default/hurricane-api/environment_config.rb.erb b/deploy/templates/default/hurricane-api/environment_config.rb.erb index 8e4812a9f2..50bd0d7d56 100644 --- a/deploy/templates/default/hurricane-api/environment_config.rb.erb +++ b/deploy/templates/default/hurricane-api/environment_config.rb.erb @@ -116,4 +116,7 @@ Rails.application.configure do <% when 'resque' %> config.active_job.queue_adapter = :resque <% end %> + + #Iubenda fallback + config.iubenda_enabled = <%= @hurricane_api_settings[:iubenda_enabled] %> end diff --git a/deploy/templates/default/hurricane-api/rca.yml.erb b/deploy/templates/default/hurricane-api/rca.yml.erb new file mode 100644 index 0000000000..3cded60b46 --- /dev/null +++ b/deploy/templates/default/hurricane-api/rca.yml.erb @@ -0,0 +1,16 @@ +default: &default + offers_search: + companies_enabled: + <% if @companies_enabled.empty? %> + [] + <% else %> + <% @companies_enabled.each do |insurance_company| %> + - <%= insurance_company %> + <% end %> + <% end %> + +<%= @env %>: + <<: *default + +test: + <<: *default diff --git a/deploy/templates/default/hurricane-api/secrets.yml.erb b/deploy/templates/default/hurricane-api/secrets.yml.erb index f6f5f62e3d..ed1eac0169 100644 --- a/deploy/templates/default/hurricane-api/secrets.yml.erb +++ b/deploy/templates/default/hurricane-api/secrets.yml.erb @@ -1,5 +1,2 @@ -staging: - secret_key_base: <%= @hurricane_api_settings[:secret_key_base] %> - -production: +<%= @env %>: secret_key_base: <%= @hurricane_api_settings[:secret_key_base] %> diff --git a/deploy/templates/default/hurricane-print/config/environments/environment_config.rb.erb b/deploy/templates/default/hurricane-print/config/environments/environment_config.rb.erb index 1d53817d6a..37358e0989 100644 --- a/deploy/templates/default/hurricane-print/config/environments/environment_config.rb.erb +++ b/deploy/templates/default/hurricane-print/config/environments/environment_config.rb.erb @@ -91,7 +91,14 @@ Rails.application.configure do <% end %> config.action_mailer.default_options = { from: "Fit2You Broker <<%= @hurricane_print_settings[:mailer][:from] %>>" } config.action_mailer.delivery_method = :smtp - config.action_mailer.smtp_settings = <%= @hurricane_print_settings[:mailer][:configuration].to_s %> + config.action_mailer.smtp_settings ={ + address: "<%= @hurricane_print_settings[:mailer][:configuration][:address] %>", + port: "<%= @hurricane_print_settings[:mailer][:configuration][:port] %>", + domain: "<%= @hurricane_print_settings[:mailer][:configuration][:domain] %>", + user_name: "<%= @hurricane_print_settings[:mailer][:configuration][:user_name] %>", + password: "<%= @hurricane_print_settings[:mailer][:configuration][:password] %>", + authentication: "<%= @hurricane_print_settings[:mailer][:configuration][:authentication] %>" + } config.action_mailer.raise_delivery_errors = true config.action_controller.asset_host = '<%= @hurricane_print_settings[:asset_host] %>' diff --git a/deploy/templates/default/hurricane-print/config/secrets.yml.erb b/deploy/templates/default/hurricane-print/config/secrets.yml.erb index 0d387d1752..c3eb325910 100644 --- a/deploy/templates/default/hurricane-print/config/secrets.yml.erb +++ b/deploy/templates/default/hurricane-print/config/secrets.yml.erb @@ -1,5 +1,8 @@ staging: secret_key_base: <%= @hurricane_print_settings[:secret_key_base] %> +preprod: + secret_key_base: <%= @hurricane_print_settings[:secret_key_base] %> + production: secret_key_base: <%= @hurricane_print_settings[:secret_key_base] %> diff --git a/deploy/templates/default/hurricane/secrets.yml.erb b/deploy/templates/default/hurricane/secrets.yml.erb index cc6e88cbac..c8449d01c4 100644 --- a/deploy/templates/default/hurricane/secrets.yml.erb +++ b/deploy/templates/default/hurricane/secrets.yml.erb @@ -1,5 +1,8 @@ staging: secret_key_base: <%= @hurricane_settings[:secret_key_base] %> +preprod: + secret_key_base: <%= @hurricane_settings[:secret_key_base] %> + production: secret_key_base: <%= @hurricane_settings[:secret_key_base] %> diff --git a/deploy/templates/default/lumen/config/aws.yml.erb b/deploy/templates/default/lumen/config/aws.yml.erb index 97bb6d9318..5288efe294 100644 --- a/deploy/templates/default/lumen/config/aws.yml.erb +++ b/deploy/templates/default/lumen/config/aws.yml.erb @@ -9,5 +9,8 @@ default: &default staging: <<: *default +preprod: + <<: *default + production: <<: *default \ No newline at end of file diff --git a/deploy/templates/default/lumen/config/mailer.yml.erb b/deploy/templates/default/lumen/config/mailer.yml.erb index 03991e2141..f4fb7d928f 100644 --- a/deploy/templates/default/lumen/config/mailer.yml.erb +++ b/deploy/templates/default/lumen/config/mailer.yml.erb @@ -8,5 +8,8 @@ default: &default staging: <<: *default +preprod: + <<: *default + production: <<: *default \ No newline at end of file diff --git a/deploy/templates/default/lumen/config/secrets.yml.erb b/deploy/templates/default/lumen/config/secrets.yml.erb index cd024e6b8e..631c399627 100644 --- a/deploy/templates/default/lumen/config/secrets.yml.erb +++ b/deploy/templates/default/lumen/config/secrets.yml.erb @@ -1,5 +1,8 @@ staging: secret_key_base: <%= @lumen_settings[:secret_key_base] %> +preprod: + secret_key_base: <%= @lumen_settings[:secret_key_base] %> + production: secret_key_base: <%= @lumen_settings[:secret_key_base] %> diff --git a/nginx/attributes/nginx.rb b/nginx/attributes/nginx.rb index ac4ff2c2a2..6aa9f01075 100644 --- a/nginx/attributes/nginx.rb +++ b/nginx/attributes/nginx.rb @@ -64,7 +64,7 @@ default[:nginx][:worker_connections] = 1024 default[:nginx][:server_names_hash_bucket_size] = 64 -default[:nginx][:proxy_read_timeout] = 60 -default[:nginx][:proxy_send_timeout] = 60 +default[:nginx][:proxy_read_timeout] = 120 +default[:nginx][:proxy_send_timeout] = 120 include_attribute "nginx::customize" diff --git a/ruby/attributes/ruby.rb b/ruby/attributes/ruby.rb index fa6c72a635..5ca526aa7f 100644 --- a/ruby/attributes/ruby.rb +++ b/ruby/attributes/ruby.rb @@ -30,7 +30,7 @@ when "2.3" default[:ruby][:major_version] = "2" default[:ruby][:minor_version] = "3" - default[:ruby][:patch_version] = "4" + default[:ruby][:patch_version] = "6" default[:ruby][:pkgrelease] = "1" default[:ruby][:full_version] = [node[:ruby][:major_version], node[:ruby][:minor_version]].join(".") @@ -39,7 +39,7 @@ when "2.2" default[:ruby][:major_version] = '2' default[:ruby][:minor_version] = '2' - default[:ruby][:patch_version] = "7" + default[:ruby][:patch_version] = "8" default[:ruby][:pkgrelease] = '1' default[:ruby][:full_version] = [node[:ruby][:major_version], node[:ruby][:minor_version]].join(".") @@ -83,4 +83,4 @@ default[:ruby][:version] = '' end -include_attribute "ruby::customize" +include_attribute "ruby::customize" \ No newline at end of file