From fee254236e909bd09af364ddcbf46bab54459f04 Mon Sep 17 00:00:00 2001 From: tomasz t Date: Fri, 1 Apr 2022 01:09:54 +0200 Subject: [PATCH] updated readme --- README.md | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index fff0e73..20cc238 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Mapa defibrylatorów AED +## Mapa defibrylatorów AED -_English: Map presenting locations of defibrillators based on OpenStreetMap data._ +__English:__ _Map presenting locations of defibrillators based on OpenStreetMap data._ To repozytorium zawiera kod strony prezentujacej lokalizacje defibrylatorów AED. @@ -15,16 +15,19 @@ Poza pobieraniem danych bezpośrednio z OSM albo za pomocą usług jak Overpass - CSV: https://aed.openstreetmap.org.pl/aed_poland.csv - Excel: https://aed.openstreetmap.org.pl/aed_poland.ods -### Gitflow -branch 'development' -> branch 'main' +### Gitflow [ENG] -Branch 'development' jest hostowany pod: https://aed.openstreetmap.org.pl/dev/ -a branch 'main' pod: https://aed.openstreetmap.org.pl/ +All changes should flow from branch `development` to branch `main`. -Github actions robi deploy gdy pojawiają się nowe commity na tych branch-ach. +Branch `development` is hosted on: https://aed.openstreetmap.org.pl/dev/ +Branch `main` is hosted on: https://aed.openstreetmap.org.pl/ -Nowe branche powinny być bazowane na 'development' i PR mergowane również do 'development'. -Następnie PR z brancha 'development' do 'main'. +Github actions deploy the site when new commits are pushed/merged into either branch. + +New branches should be based on `development` branch. +Pull Requests (PR) should be targeting `development` branch. + +To promote changes from dev env to prod make a PR from `development` to `main`. ### Technical information [ENG] @@ -33,13 +36,11 @@ Any webserver (Nginx/Apache) or things like S3 or GitHub Pages can be used to ho File _js/osm-integration.js_ contains placeholders for OAuth1 tokens for OpenStreetMap application which are filled during deploy (this allows us to have both prod and dev environments one pointing to OSM DEV API one to osm.org). -The only thing that requires code execution is Python script that downloads data from Overpass API and converts it to GeoJSON and CSV files. +The only thing that requires code execution is __Python script__ that downloads data from Overpass API and converts it to GeoJSON and CSV files. -File _requirements.txt_ contains packages used by python script. The script was __updated__ to create additional layer from Google Sheets to before use you would need to __comment out last line__ from _download_data.py_ +File _requirements.txt_ contains packages used by python script. -Example CSV and GeoJSON files are uploaded to repo. - -#### Scripts used to deploy on our server +#### Scripts used to deploy on our server [ENG] Stack: Ubuntu/Nginx @@ -48,14 +49,16 @@ Clone repo: git clone --branch main --single-branch https://github.com/openstreetmap-polska/aed-mapa.git /home/aeduser/aed-mapa/ ``` -Command to deploy are in _.github/workflows/_ but they pretty much boil down to copying files to /var/www/. +Command to deploy are in _.github/workflows/_ but in short they copy the files to temporary location then replace the OAuth1 token mentioned earlier and then copy files to `/var/www/html/`. Download new data (set crontab to run it periodically): ```bash -python3 /home/aeduser/aed-mapa/web/download_data.py /home/aeduser/data_dir/ -cp /home/aeduser/data_dir/aed_poland.geojson /var/www/html/aed_poland.geojson -cp /home/aeduser/data_dir/aed_poland_metadata.json /var/www/html/aed_poland_metadata.json -cp /home/aeduser/data_dir/aed_poland.csv /var/www/html/aed_poland.csv +python3 /home/aeduser/aed-mapa/download_data.py /home/aeduser/data_prod/ /home/aeduser/ + +cp /home/aeduser/data_prod/aed_poland.ods /var/www/html/aed_poland.ods +cp /home/aeduser/data_prod/aed_poland.geojson /var/www/html/aed_poland.geojson +cp /home/aeduser/data_prod/aed_poland_metadata.json /var/www/html/aed_poland_metadata.json +cp /home/aeduser/data_prod/aed_poland.csv /var/www/html/aed_poland.csv ``` ### Alternatives / Inne podobne @@ -63,7 +66,7 @@ cp /home/aeduser/data_dir/aed_poland.csv /var/www/html/aed_poland.csv * https://github.com/chnuessli/defikarte.ch - https://defikarte.ch/ -### Additional info about development +### Additional info about development [ENG] #### Editing style