1
0
forked from ScoDoc/ScoDoc

deb creating venv in postinst

This commit is contained in:
Emmanuel Viennet 2021-08-24 23:36:58 +02:00
parent 9e441232a4
commit 3589c69bca
3 changed files with 20 additions and 5 deletions

View File

@ -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

View File

@ -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é."

View File

@ -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