Skip to content

fix(infra): simplifie le déploiement de camino

BITARD Michaël requested to merge new-deployment into develop

Created by: MichaelBitard

MIGRATION:

  • create /srv/www/camino
  • récupérer le docker-compose.yml
  • merge .env
    • on prend api/.env, on préfixe API_ sur URL et PORT (On rajoute https à API_URL)
    • on prend ui/.env, il y'a UI_URL, API_MATOMO_MONTHS et API_SENTRY_URL
    • on rajoute DOC_URL, DOC_PORT
  • récupérer les données
    • on arrête les serveurs docker stop camino_api_cron camino_api_app camino_ui_app camino_api_db
    • la bdd
      • on crée le dossier postgresql sudo mkdir /srv/www/camino/postgresql && sudo chown 999:999 /srv/www/camino/postgresql
      • docker run -ti --rm --entrypoint "" -u postgres -v camino-api_data:/data -v /srv/www/camino/postgresql:/new_data postgis/postgis:12-3.2 bash -c "cp -Rv /data/* /new_data"
    • les fichiers
      • docker run -ti --rm --entrypoint "" -u root -v camino-api_files:/files -v /srv/www/camino/files:/new_files postgis/postgis:12-3.2 bash -c "cp -Rv /files/* /new_files"
  • docker rm camino_api_cron camino_api_app camino_ui_app camino_api_db
  • CAMINO_TAG=develop docker-compose up -d
  • docker restart nginx-gen nginx-proxy nginx-letsencrypt

CLEANUP AFTER MIGRATION:

  • migrate backup scripts
    • files-backup: docker cp camino_api_app:/packages/api/files/. /srv/backups/files/
    • files-restore: docker cp /srv/backups/files/. camino_api_app:/packages/api/files/
    • sudo rm -f project-create project-delete confirm
  • docker volume rm camino-api_data camino-api_files
  • sudo rm -rf /srv/www/camino-api /srv/www/camino-ui /srv/www/camino-api-docs /srv/www/camino-portainer

Merge request reports