alphagov / trade-tariff-backend

Enabling the population and distribution via API of UK Customs tariffs and duties
MIT License
7 stars 6 forks source link

Remove references to FACTER_govuk_platform #179

Closed samjsharpe closed 10 years ago

samjsharpe commented 10 years ago

We are going to remove FACTER_govuk_platform as an environment variable. It is still referenced in router.rake at https://github.com/alphagov/trade-tariff-backend/blob/master/lib/tasks/router.rake#L14-L19

FACTER_govuk_platform in all of our environments, including preview is always set to 'production'

I suggest converting that to

  task :register_application => :router_environment do
    domain_name = ENV['GOVUK_APP_DOMAIN']
    url = "#{@slug}.#{domain_name}"
    @logger.info "Registering application..."
    @router.update_application @slug, url
  end

I suggest that this is modified to just return Rails.env: https://github.com/alphagov/trade-tariff-backend/blob/af63337c2cfd2918165d51c2d5be5a59e522a6e6/lib/trade_tariff_backend.rb#L32-L34

And obviously the associated test updated: https://github.com/alphagov/trade-tariff-backend/blob/a7d61f2cb0f9107798d05b9b451ec5d641fda1b7/spec/unit/trade_tariff_backend_spec.rb