mirror of
https://github.com/mozilla/ichnaea.git
synced 2025-12-05 01:10:44 +00:00
Switch to make update-vendored, doc fixes
This commit is contained in:
8
Makefile
8
Makefile
@@ -44,7 +44,7 @@ default:
|
|||||||
@echo " docs - generate Sphinx HTML documentation, including API docs"
|
@echo " docs - generate Sphinx HTML documentation, including API docs"
|
||||||
@echo " buildjs - generate js static assets"
|
@echo " buildjs - generate js static assets"
|
||||||
@echo " buildcss - generate css static assets"
|
@echo " buildcss - generate css static assets"
|
||||||
@echo " download - re-download vendor source and test data"
|
@echo " update-vendored - re-download vendor source and test data"
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo " help - see this text"
|
@echo " help - see this text"
|
||||||
@echo ""
|
@echo ""
|
||||||
@@ -133,6 +133,6 @@ runservices: my.env .docker-build
|
|||||||
stop: my.env
|
stop: my.env
|
||||||
${DC} stop
|
${DC} stop
|
||||||
|
|
||||||
.PHONY: download
|
.PHONY: update-vendored
|
||||||
download: my.env
|
update-vendored: my.env
|
||||||
${DC} run --rm --no-deps app shell make -f docker.make download
|
${DC} run --rm --no-deps app shell make -f docker.make update_vendored
|
||||||
|
|||||||
38
docker.make
38
docker.make
@@ -34,19 +34,19 @@ all:
|
|||||||
@echo ""
|
@echo ""
|
||||||
@echo "make rules:"
|
@echo "make rules:"
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo " build_deps - build datamaps and libmaxmind"
|
@echo " build_deps - build datamaps and libmaxmind"
|
||||||
@echo " build_python_deps - install and check python dependencies"
|
@echo " build_python_deps - install and check python dependencies"
|
||||||
@echo " build_geocalc - compile and install geocalclib"
|
@echo " build_geocalc - compile and install geocalclib"
|
||||||
@echo " check - check that C libraries are available to Python"
|
@echo " check - check that C libraries are available to Python"
|
||||||
@echo " download - download libraries and test data"
|
@echo " update_vendored - update libraries and test data"
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo " build_datamaps - build datamaps binaries"
|
@echo " build_datamaps - build datamaps binaries"
|
||||||
@echo " build_libmaxmind - build libmaxmind library"
|
@echo " build_libmaxmind - build libmaxmind library"
|
||||||
@echo " download_datamaps - download datamaps source"
|
@echo " update_datamaps - update datamaps source"
|
||||||
@echo " download_libmaxmind - download libmaxmind source"
|
@echo " update_libmaxmind - update libmaxmind source"
|
||||||
@echo " download_test_data - download MaxMind DB test data"
|
@echo " update_test_data - update MaxMind DB test data"
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo " help - see this text"
|
@echo " help - see this text"
|
||||||
|
|
||||||
build_datamaps:
|
build_datamaps:
|
||||||
cd $(VENDOR); tar zxf $(DATAMAPS_NAME).tar.gz
|
cd $(VENDOR); tar zxf $(DATAMAPS_NAME).tar.gz
|
||||||
@@ -82,20 +82,20 @@ build_check:
|
|||||||
$(PYTHON) -c "import sys; from ichnaea.geoip import GeoIPWrapper; sys.exit(not GeoIPWrapper('ichnaea/tests/data/GeoIP2-City-Test.mmdb').check_extension())"
|
$(PYTHON) -c "import sys; from ichnaea.geoip import GeoIPWrapper; sys.exit(not GeoIPWrapper('ichnaea/tests/data/GeoIP2-City-Test.mmdb').check_extension())"
|
||||||
$(PYTHON) -c "import sys; from ichnaea.geocode import GEOCODER; sys.exit(not GEOCODER.region(51.5, -0.1) == 'GB')"
|
$(PYTHON) -c "import sys; from ichnaea.geocode import GEOCODER; sys.exit(not GEOCODER.region(51.5, -0.1) == 'GB')"
|
||||||
|
|
||||||
.PHONY: download_datamaps
|
.PHONY: update_datamaps
|
||||||
download_datamaps:
|
update_datamaps:
|
||||||
cd $(VENDOR) && wget -q \
|
cd $(VENDOR) && wget -q \
|
||||||
-O $(DATAMAPS_NAME).tar.gz \
|
-O $(DATAMAPS_NAME).tar.gz \
|
||||||
https://github.com/ericfischer/datamaps/archive/$(DATAMAPS_COMMIT).tar.gz
|
https://github.com/ericfischer/datamaps/archive/$(DATAMAPS_COMMIT).tar.gz
|
||||||
|
|
||||||
.PHONY: download_libmaxmind
|
.PHONY: update_libmaxmind
|
||||||
download_libmaxmind:
|
update_libmaxmind:
|
||||||
cd $(VENDOR) && wget -q \
|
cd $(VENDOR) && wget -q \
|
||||||
-O $(LIBMAXMIND_NAME).tar.gz \
|
-O $(LIBMAXMIND_NAME).tar.gz \
|
||||||
https://github.com/maxmind/libmaxminddb/releases/download/$(LIBMAXMIND_VERSION)/$(LIBMAXMIND_NAME).tar.gz
|
https://github.com/maxmind/libmaxminddb/releases/download/$(LIBMAXMIND_VERSION)/$(LIBMAXMIND_NAME).tar.gz
|
||||||
|
|
||||||
.PHONY: download_test_data
|
.PHONY: update_test_data
|
||||||
download_test_data:
|
update_test_data:
|
||||||
cd $(TEST_DATA) && wget -q \
|
cd $(TEST_DATA) && wget -q \
|
||||||
-O GeoIP2-City-Test.json \
|
-O GeoIP2-City-Test.json \
|
||||||
https://raw.githubusercontent.com/maxmind/MaxMind-DB/master/source-data/GeoIP2-City-Test.json && \
|
https://raw.githubusercontent.com/maxmind/MaxMind-DB/master/source-data/GeoIP2-City-Test.json && \
|
||||||
@@ -106,5 +106,5 @@ download_test_data:
|
|||||||
-O GeoIP2-Connection-Type-Test.mmdb \
|
-O GeoIP2-Connection-Type-Test.mmdb \
|
||||||
https://github.com/maxmind/MaxMind-DB/raw/master/test-data/GeoIP2-Connection-Type-Test.mmdb
|
https://github.com/maxmind/MaxMind-DB/raw/master/test-data/GeoIP2-Connection-Type-Test.mmdb
|
||||||
|
|
||||||
.PHONY: download
|
.PHONY: update_vendored
|
||||||
download: download_datamaps download_libmaxmind download_test_data
|
update_vendored: update_datamaps update_libmaxmind update_test_data
|
||||||
|
|||||||
@@ -253,17 +253,17 @@ with a web brower.
|
|||||||
|
|
||||||
Updating Test GeoIP Data and Libraries
|
Updating Test GeoIP Data and Libraries
|
||||||
======================================
|
======================================
|
||||||
The development environment uses a test MaxMind GeoIP database, and a test
|
The development environment uses a test MaxMind GeoIP database, and the Ichnaea
|
||||||
confirms that this is less than 1000 days old. To update this database and
|
test suite will fail if this is more than 1000 days old. To update this
|
||||||
confirm tests pass, run::
|
database and confirm tests pass, run::
|
||||||
|
|
||||||
$ make download test
|
$ make update-vendored test
|
||||||
|
|
||||||
Commit the refreshed files.
|
Commit the refreshed files.
|
||||||
|
|
||||||
This command can also be used to updated `libmaxmindb` and the `datamaps`
|
This command can also be used to updated ``libmaxmindb`` and the ``datamaps``
|
||||||
source. Update `docker.make` for the desired versions, and run::
|
source. Update ``docker.make`` for the desired versions, and run::
|
||||||
|
|
||||||
$ make download build test
|
$ make update-vendored build test
|
||||||
|
|
||||||
Commit the updated source tarballs.
|
Commit the updated source tarballs.
|
||||||
|
|||||||
@@ -9,4 +9,5 @@ http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to
|
|||||||
Creative Commons, 444 Castro Street, Suite 900, Mountain View,
|
Creative Commons, 444 Castro Street, Suite 900, Mountain View,
|
||||||
California, 94041, USA
|
California, 94041, USA
|
||||||
|
|
||||||
To download fresh copies and confirm they work, run ``make download test``.
|
To download fresh copies and confirm they work, run
|
||||||
|
``make update-vendored test``.
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ class TestHeartbeat(object):
|
|||||||
assert isinstance(data[name]["time"], int)
|
assert isinstance(data[name]["time"], int)
|
||||||
assert data[name]["time"] >= 0
|
assert data[name]["time"] >= 0
|
||||||
|
|
||||||
# Run "make download" when this gets too old
|
# Run "make update-vendored" when this gets too old
|
||||||
assert 1 < data["geoip"]["age_in_days"] < 1000
|
assert 1 < data["geoip"]["age_in_days"] < 1000
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
2
vendor/README.rst
vendored
2
vendor/README.rst
vendored
@@ -3,4 +3,4 @@ Vendor
|
|||||||
|
|
||||||
These tarballs where downloaded from https://github.com/ericfischer/datamaps and
|
These tarballs where downloaded from https://github.com/ericfischer/datamaps and
|
||||||
https://github.com/maxmind/libmaxminddb. To download new versions and confirm
|
https://github.com/maxmind/libmaxminddb. To download new versions and confirm
|
||||||
they work, update ``docker.make`` and run ``make download build test``.
|
they work, update ``docker.make`` and run ``make update-vendored build test``.
|
||||||
|
|||||||
Reference in New Issue
Block a user