Skip to content

Latest commit

 

History

History
96 lines (62 loc) · 1.96 KB

INSTALL.md

File metadata and controls

96 lines (62 loc) · 1.96 KB

Installing OpenStreetMap Welcome Tool

Requirements

  • Install dependencies:

    composer install
  • Create database (if needed):

    php bin/console doctrine:database:create
  • Initialize schema:

    php bin/console doctrine:schema:create
  • Create OSMCHA_API_KEY in your environment with your OSMCha API key

Run locally

Symfony Local Web Server

  • Install Symfony CLI
  • Run symfony server:start
  • Browse the given URL

Check Symfony local server documentation for more information.

Docker

docker build . --tag osm-welcome-tool
docker run --detach --publish 80:80 --env-file .env.local osm-welcome-tool

Deploy

Check Symfony deployment documentation.

Using Deployer

vendor/bin/dep deploy --branch=2.x welcome.osm.be

Automated update

Cron Job (SQLite)

Create an osm-welcome-tool file in /etc/cron.daily folder (for a daily update):

#!/bin/sh

BACKUP_DIRECTORY=/root/osm-welcome-tool
BACKUP_FILENAME=data.db

mkdir -p $BACKUP_DIRECTORY

# Remove all backups older than 30 days
find $BACKUP_DIRECTORY/$BACKUP_FILENAME.* -mtime +30 -delete
# Backup database
cp "/var/www/osm-welcome-tool/current/var/data.db" "$BACKUP_DIRECTORY/$BACKUP_FILENAME.$(date +"%Y%m%d")"

# Trigger update
cd "/var/www/osm-welcome-tool/current/"
php bin/console welcome:update

Translating OpenStreetMap Welcome Tool

  1. Update XLIFF files for English

    php bin/console translation:extract --force en
  2. Upload XLIFF files for English to Crowdin

    php bin/console translation:push --force --locales en
  3. Update translations in Crowdin

  4. Download XLIFF files from Crowdin

    php bin/console translation:pull --force