A platform for distributing OpenStreetMap data presets for cities.
- Osmium Tool (v1.14.0)
- Node (see .nvmrc) (To manage multiple node versions we recommend nvm)
- Yarn package manager
- Docker
Copy .env.example
to .env
. The example file contains some of the environment variables that can be set to configure the platform.
docker-compose up
This command will start a Gitea server and mount data volumes to the directory ./app-data
on your local filesystem.
-
Access the server at http://localhost:3000, create an user name
runner
that will be used for updating the git repositories. Save its password on your password manager as it won't be possible to reset it on a development environment. -
Generate an access token with
write:org
anddelete_repo
scope. -
Copy token to
GITEA_ACCESS_TOKEN
environment variable in.env
file
Activate required Node version, if nvm is installed:
nvm install
Install Node modules:
yarn
Initialize history file:
yarn cli init-history
This command will download the full planet history and perform a geographic extract for the area covered by osmforcities defined in config/coverage.poly.
Initialize remote git repository:
yarn cli context cities-of-brazil setup
The following command will apply all the daily diff files available at Planet OSM. This is necessary because the full history file is always outdated by some days.
yarn cli update-history --recursive
At this point you should have the full history available locally for processing. Now run the following to extract and publish data to the git repository:
yarn cli context cities-of-brazil update --recursive
To create the Docker images and publish them to the Docker registry, we will utilize Charpress.
pip install chartpress
docker login
chartpress --push
Copy the docker images tag version into your config osm-for-cities/values.yaml
file.
Once you have access to your kubernetes cluster, you can install Gitea and Runner applications using helm. Make sure that you have the correct configuration in osm-for-cities/values.develop.yaml
or osm-for-cities/values.production.yaml
file.
# namespace for staging will be default
# Install
helm install staging ./osm-for-cities -f ./osm-for-cities/values.staging.yaml
# Upgrade
helm upgrade staging ./osm-for-cities -f ./osm-for-cities/values.staging.yaml
# Delete
helm delete staging
kubectl create namespace production
# Install
helm install prod ./osm-for-cities -f ./osm-for-cities/values.production.yaml --namespace production
# Upgrade
helm upgrade prod ./osm-for-cities -f ./osm-for-cities/values.production.yaml --namespace production
# Delete
helm delete prod -n production