diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e70b15709..e31d8cea3 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,7 +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 priv/static/GeoLite2-City.mmdb -s + - 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 627eb09fd..474c73cae 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" } ]