From e8196de7904ac0ef61282f4041a405779e50cb3f Mon Sep 17 00:00:00 2001 From: Slawosz Slawinski Date: Thu, 7 Dec 2023 09:38:59 +0000 Subject: [PATCH] Use Ordnance Survey API --- .github/workflows/aks_deploy.yml | 2 +- Dockerfile | 2 +- Makefile | 2 +- app/lib/local_authority/search.rb | 2 +- config/initializers/geocoder.rb | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/aks_deploy.yml b/.github/workflows/aks_deploy.yml index 527e418..6719ff9 100644 --- a/.github/workflows/aks_deploy.yml +++ b/.github/workflows/aks_deploy.yml @@ -33,7 +33,7 @@ jobs: runs-on: ubuntu-latest env: - GOOGLE_MAP_API_KEY: someapikey + ORDNANCE_SURVEY_API_KEY: someapikey services: postgres: diff --git a/Dockerfile b/Dockerfile index b17cb8e..67119f6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,7 +41,7 @@ RUN yarn install --frozen-lockfile --check-files # Copy all files to /app (except what is defined in .dockerignore) COPY . . -ENV GOOGLE_MAP_API_KEY="just-for-assets" +ENV ORDNANCE_SURVEY_API_KEY="just-for-assets" # Precompile assets RUN RAILS_ENV=production SECRET_KEY_BASE=required-to-run-but-not-used \ bundle exec rails assets:precompile diff --git a/Makefile b/Makefile index f3ef3d8..11ae855 100644 --- a/Makefile +++ b/Makefile @@ -135,7 +135,7 @@ get-cluster-credentials: set-azure-account aks-console: get-cluster-credentials $(if $(PULL_REQUEST_NUMBER), $(eval export APP_ID=review-$(PULL_REQUEST_NUMBER)) , $(eval export APP_ID=$(CONFIG_LONG))) - kubectl -n ${NAMESPACE} exec -ti --tty deployment/teaching-school-hub-finder-${APP_ID} -- /bin/sh -c "cd /app && bundle exec rails c" + kubectl -n ${NAMESPACE} exec -ti --tty deployment/cpd-tsh-${APP_ID} -- /bin/sh -c "cd /app && bundle exec rails c" aks-ssh: get-cluster-credentials $(if $(PULL_REQUEST_NUMBER), $(eval export APP_ID=review-$(PULL_REQUEST_NUMBER)) , $(eval export APP_ID=$(CONFIG_LONG))) diff --git a/app/lib/local_authority/search.rb b/app/lib/local_authority/search.rb index d7adc56..11e6443 100644 --- a/app/lib/local_authority/search.rb +++ b/app/lib/local_authority/search.rb @@ -19,7 +19,7 @@ def search_centre end def geo_result - @geo_result ||= Geocoder.search("#{@query}, UK", params: {limit: 1, polygon_geojson: 1, countrycodes: 'gb'}).first + @geo_result ||= Geocoder.search("#{@query}, UK").first end def search_polygon diff --git a/config/initializers/geocoder.rb b/config/initializers/geocoder.rb index dc3f57a..6b16603 100644 --- a/config/initializers/geocoder.rb +++ b/config/initializers/geocoder.rb @@ -1 +1 @@ -Geocoder.configure(lookup: :google, api_key: ENV.fetch('GOOGLE_MAP_API_KEY')) +Geocoder.configure(lookup: :uk_ordnance_survey_names, api_key: ENV.fetch('ORDNANCE_SURVEY_API_KEY'))