From 3589c69bcaa2223365832d5d6e658dc1bbb75bdd Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 24 Aug 2021 23:36:58 +0200 Subject: [PATCH] deb creating venv in postinst --- README.md | 3 ++- tools/build_release.sh | 8 ++++---- tools/debian/postinst | 14 ++++++++++++++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e285d7b798..6ba4f8055b 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,8 @@ Expérimental: - installer la clé: en root sur le serveur, lancer - + + apt-get install gnupg wget -O - https://scodoc.org/misc/scodoc-repo.gpg.key | apt-key add - - apt-get update && apt-get install scodoc9 diff --git a/tools/build_release.sh b/tools/build_release.sh index 93701ad9a2..855c200907 100644 --- a/tools/build_release.sh +++ b/tools/build_release.sh @@ -7,7 +7,7 @@ die() { } PACKAGE_NAME=scodoc9 -RELEASE_TAG=9.0.0-b +RELEASE_TAG=9.0.0-d VERSION=9.0.0 RELEASE=1 ARCH="amd64" @@ -53,12 +53,12 @@ mv "$SCODOC_DIR"/tools/debian "$slash"/DEBIAN || die "can't install DEBIAN dir" chmod 755 "$slash"/DEBIAN/*inst || die "can't chmod debian scripts" # ------------ CREATION DU VIRTUALENV -echo "Creating python3 virtualenv..." -(cd $SCODOC_DIR && python3 -m venv venv) || die "error creating Python 3 virtualenv" +#echo "Creating python3 virtualenv..." +#(cd $SCODOC_DIR && python3 -m venv venv) || die "error creating Python 3 virtualenv" # ------------ INSTALL DES PAQUETS PYTHON (3.9) # pip in our env, as user "scodoc" -(cd $SCODOC_DIR && source venv/bin/activate && pip install wheel && pip install -r requirements-3.9.txt) || die "Error installing python packages" +#(cd $SCODOC_DIR && source venv/bin/activate && pip install wheel && pip install -r requirements-3.9.txt) || die "Error installing python packages" # -------- THE END echo "Terminé." diff --git a/tools/debian/postinst b/tools/debian/postinst index 2c9254c474..ac437b6211 100644 --- a/tools/debian/postinst +++ b/tools/debian/postinst @@ -31,6 +31,20 @@ SCODOC_RELEASE=$(grep SCOVERSION sco_version.py | awk '{ print substr($3, 2, len SVERSION=$(curl --silent http://scodoc.iutv.univ-paris13.fr/scodoc-installmgr/version?mode=install\&release="$SCODOC_RELEASE") echo "$SVERSION" > "${SCODOC_VERSION_DIR}/scodoc.sn" +# --- XXX TODO générer SECRET_KEY dans .env ? +# idealement, demander le mail de l'admin et son mot de passe lors de la première install +# python3 -c "import uuid; print(uuid.uuid4().hex)" + +# ------------ CREATION DU VIRTUALENV +#echo "Creating python3 virtualenv..." +(cd $SCODOC_DIR && python3 -m venv venv) || die "Error creating Python 3 virtualenv" + +# ------------ INSTALL DES PAQUETS PYTHON (3.9) +# pip in our env, as user "scodoc" +(cd $SCODOC_DIR && source venv/bin/activate && pip install wheel && pip install -r requirements-3.9.txt) || die "Error installing python packages" + + + # --- POSTGRESQL # --- Ensure postgres user "scodoc" ($POSTGRES_USER) exists init_postgres_user