From 28987fc6895c4e55a49714d5661ada92a68ece29 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 9 Jul 2018 16:28:34 +0200 Subject: [PATCH] Download GeoIP files Signed-off-by: Thomas Citharel Debug Signed-off-by: Thomas Citharel Debug geoip fils Signed-off-by: Thomas Citharel Damn it, forgot you Signed-off-by: Thomas Citharel Debug Signed-off-by: Thomas Citharel Fix Signed-off-by: Thomas Citharel Debug Signed-off-by: Thomas Citharel Finalize Signed-off-by: Thomas Citharel --- .gitlab-ci.yml | 2 ++ config/config.exs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fde05ca7..e31d8cea 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,6 +10,7 @@ variables: POSTGRES_USER: postgres POSTGRES_PASSWORD: "" POSTGRES_HOST: postgres + GEOLITE_CITIES_PATH: "/builds/tcit/eventos/priv/static/GeoLite2-City.mmdb" cache: key: "$CI_JOB_NAME" @@ -26,6 +27,7 @@ before_script: - mix deps.get - MIX_ENV=test mix ecto.create - MIX_ENV=test mix ecto.migrate + - curl http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz --output GeoLite2-City.tar.gz -s && tar zxf GeoLite2-City.tar.gz && mv GeoLite2-City_*/GeoLite2-City.mmdb priv/static/GeoLite2-City.mmdb mix: script: diff --git a/config/config.exs b/config/config.exs index 627eb09f..474c73ca 100644 --- a/config/config.exs +++ b/config/config.exs @@ -54,6 +54,6 @@ config :geolix, %{ id: :city, adapter: Geolix.Adapter.MMDB2, - source: "priv/static/GeoLite2-City.mmdb" + source: System.get_env("GEOLITE_CITIES_PATH") || "priv/static/GeoLite2-City.mmdb" } ]