Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EVO - Script de synchro / Update sources static Python #248

Open
Gaetanbrl opened this issue Jun 19, 2023 · 0 comments
Open

EVO - Script de synchro / Update sources static Python #248

Gaetanbrl opened this issue Jun 19, 2023 · 0 comments

Comments

@Gaetanbrl
Copy link
Member

Gaetanbrl commented Jun 19, 2023

Description

Par défaut, nous avons proposé un script permettant de reporter les fichiers static de la racine vers le répertoire /srv/python/mviewerstudio_backend.

https://github.com/jdev-org/mviewerstudio/blob/develop-meg/srv/python/sync.sh

Un autre fichier est utilisé par @spelhate et @lecault.

  • Le script par défaut est pratique après un git pull mais aussi pour développer et faire un git push des sources static vers les sources de la racine (le répertoire static étant ignoré par git lorsqu'on a modifié les fichiers).
  • Le script ci-dessous permet de réinstaller l'env python et de récupérer une config à copier dans le répertoire static.

Il serait intéressant de fusionner ces deux scripts pour conserver ces deux avantages.

Code du script de GEOB à fusionner dans le script par défaut

#!/bin/bash

# TODO : param $1 - MVIEWERSTUDIO_DIR
MVIEWERSTUDIO\_DIR="/mnt/ext/var/geobretagne/dev/mviewerstudio"

cd $MVIEWERSTUDIO\_DIR
#git pull origin develop-meg-vsr
#git pull origin
STATIC\_DIR="${MVIEWERSTUDIO\_DIR}/srv/python/mviewerstudio\_backend/static"
rm -Rf "${STATIC\_DIR}"
mkdir -p "${MVIEWERSTUDIO\_DIR}/srv/python/mviewerstudio\_backend/static/apps"
cp -r "${MVIEWERSTUDIO\_DIR}/css" "${STATIC\_DIR}"
cp -r "${MVIEWERSTUDIO\_DIR}/img" "${STATIC\_DIR}"
cp -r "${MVIEWERSTUDIO\_DIR}/js" "${STATIC\_DIR}"
cp -r "${MVIEWERSTUDIO\_DIR}/lib" "${STATIC\_DIR}"
cp -r "${MVIEWERSTUDIO\_DIR}/index.html" "${STATIC\_DIR}"
cp "${MVIEWERSTUDIO\_DIR}/mviewerstudio.i18n.json" "${STATIC\_DIR}/mviewerstudio.i18n.json"
cp "${MVIEWERSTUDIO\_DIR}/config-geob.json" "${STATIC\_DIR}/apps/config.json"
cd "${MVIEWERSTUDIO\_DIR}/srv/python"

# install python venv and requirements

# TODO : param $2 - .venv name
rm -Rf .venv
python3.9 -m venv .venv
. "${MVIEWERSTUDIO\_DIR}/srv/python/.venv/bin/activate"
pip install -r requirements.txt -r dev-requirements.txt
pip install -e .
deactivate
#sudo systemctl restart mviewerstudio
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant