Skip to content
gillux edited this page Aug 8, 2023 · 18 revisions

This page describes how Tatoeba is being deployed.

Production website

  1. Pull any translations from Transifex and commit them.

    ./tools/update-translations.sh
    git add src/Locale/
    git commit -m "Pull translations from Transifex"
    git show | grep -E '^(diff|\+msgstr "[^"])' | less # optionally have a look at the new UI strings
    git push
  2. Merge dev into master, tag as prod_{YYYY}-{MM}-{DD} and push everything.

    git checkout master
    git merge dev
    git tag prod_{YYYY}-{MM}-{DD}
    git push
    git push --tags
  3. Connect via SSH to the server.

  4. Pull the code in the /var/code directory and pull (the branch should be set to master already).

    cd /var/code
    git checkout master
    git pull
  5. Run the script to create a prod folder (create-new-prod-folder.sh).

    cd /var
    ./create-new-prod-folder.sh --no-dry-run
  6. Activate the new prod folder (set-prod-folder.sh).

    ./set-prod-folder.sh {SHA}
  7. Reload php-fpm to reset the cache.

    systemctl reload php7.3-fpm

Dev website

  1. Connect via SSH to the server.

  2. Go to the website directory and pull the code. (We use git reset in order to avoid conflicts with new translations files that are constantly being pulled from Transifex.)

    cd /srv/tatoeba.org/www
    git reset --hard origin/dev && git pull
  3. Run migration scripts, if any.

    bin/cake migrations migrate
  4. Update dependencies if composer.lock was modified

    composer install
  5. Update assets, if needed.

    bin/cake asset_compress build -f
  6. Reload php-fpm to reset the cache.

    systemctl reload php7.3-fpm

Adding a new language

  1. Connect to the database using mariadb tatoeba and run the add_new_language() SQL procedure

    CALL add_new_language('xxx', 0000); # replace xxx with the actual ISO code and 0000 with the list number
  2. Create new indexes (this automatically reloads Manticore configuration too)

    idx=xxx # replace xxx with the actual ISO code
    /var/www-prod/bin/cake sphinx_indexes update main $idx
    /var/www-prod/bin/cake sphinx_indexes update delta $idx
  3. Make sure it works

    idx=xxx # replace xxx with the actual ISO code
    echo "select id,text_len from ${idx}_main_index,${idx}_delta_index limit 10;" | mysql -P9306 --protocol=tcp