forked from ScoDoc/ScoDoc
fix deb scripts
This commit is contained in:
parent
18d6b63569
commit
652599aa40
22
README.md
22
README.md
@ -22,20 +22,30 @@ Flask, SQLAlchemy, au lien de Python2/Zope dans les versions précédentes).
|
|||||||
**Version 9.0.0-alpha**: développement en cours, certaines pages fonctionnent,
|
**Version 9.0.0-alpha**: développement en cours, certaines pages fonctionnent,
|
||||||
d'autres pas: merci de signaler les erreurs.
|
d'autres pas: merci de signaler les erreurs.
|
||||||
|
|
||||||
### État actuel (15 août 21)
|
### État actuel (24 août 21)
|
||||||
|
|
||||||
- serveur de développement fonctionnel (tests en mode "production"
|
- Tests en cours, notamment système d'installation et de migration.
|
||||||
sous gunicorn+nginx en cours).
|
|
||||||
|
|
||||||
- logs à revoir (trop verbeux), dans `/opt/scodoc-data/log`
|
**Non intégré**
|
||||||
|
|
||||||
**En cours:**
|
- feuille "placement" (en cours)
|
||||||
|
|
||||||
- nettoyage du code, finalisation tests et intégration.
|
- ancien module "Entreprises" (obsolete)
|
||||||
|
|
||||||
|
|
||||||
## Installation (sur Debian 11 / python 3.9.2)
|
## Installation (sur Debian 11 / python 3.9.2)
|
||||||
|
|
||||||
|
Expérimental:
|
||||||
|
|
||||||
|
- installer Debian 11
|
||||||
|
|
||||||
|
- installer la clé:
|
||||||
|
en root sur le serveur, lancer
|
||||||
|
|
||||||
|
wget -O - https://scodoc.org/misc/scodoc-repo.gpg.key | apt-key add -
|
||||||
|
|
||||||
|
- apt-get update && apt-get install scodoc9
|
||||||
|
|
||||||
|
|
||||||
Voir https://scodoc.org/GuideInstallDebian11
|
Voir https://scodoc.org/GuideInstallDebian11
|
||||||
|
|
||||||
|
57
tools/build_release.sh
Normal file
57
tools/build_release.sh
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Préparation d'une release ScoDoc:
|
||||||
|
die() {
|
||||||
|
echo; echo "Erreur: $1"; echo
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
PACKAGE_NAME=scodoc9
|
||||||
|
RELEASE_TAG=9.0.0
|
||||||
|
VERSION=9.0.0
|
||||||
|
RELEASE=1
|
||||||
|
ARCH="amd64"
|
||||||
|
FACTORY_DIR="/opt/factory"
|
||||||
|
DEST_DIR="$PACKAGE_NAME"_"$VERSION"-"$RELEASE"_"$ARCH"
|
||||||
|
|
||||||
|
GIT_RELEASE_URL=https://scodoc.org/git/viennet/ScoDoc/archive/${RELEASE_TAG}.tar.gz
|
||||||
|
|
||||||
|
SCODOC_USER=scodoc
|
||||||
|
# Safety checks
|
||||||
|
[ -z "$FACTORY_DIR" ] && die "empty FACTORY_DIR"
|
||||||
|
[ "$(id -nu)" != "$SCODOC_USER" ] && die "Erreur: le script $0 doit être lancé par l'utilisateur $SCODOC_USER"
|
||||||
|
|
||||||
|
# Création répertoire du paquet, et de opt
|
||||||
|
slash="$FACTORY_DIR"/"$DEST_DIR"
|
||||||
|
optdir="$slash"/opt
|
||||||
|
|
||||||
|
[ -e "$slash" ] && die "Directory $slash already exists"
|
||||||
|
mkdir -p "$optdir" || die "mkdir failure for $optdir"
|
||||||
|
|
||||||
|
# On récupère la release
|
||||||
|
archive="$FACTORY_DIR"/"$PACKAGE_NAME-$RELEASE_TAG".tar.gz
|
||||||
|
echo "Downloading $GIT_RELEASE_URL ..."
|
||||||
|
curl -o "$archive" "$GIT_RELEASE_URL" || die "curl failure for $GIT_RELEASE_URL"
|
||||||
|
|
||||||
|
# On décomprime
|
||||||
|
# normalement le résultat s'appelle "scodoc" et va dans opt
|
||||||
|
(cd "$optdir" && tar xfz "$archive") || die "tar extraction failure"
|
||||||
|
|
||||||
|
SCODOC_DIR="$optdir"/scodoc
|
||||||
|
[ -d "$SCODOC_DIR" ] || die "die Erreur: $SCODOC_DIR inexistant"
|
||||||
|
|
||||||
|
# Puis on déplace les fichiers de config (nginx, systemd, ...)
|
||||||
|
# nginx:
|
||||||
|
mkdir -p "$slash"/etc/nginx/sites-available || die "can't mkdir nginx config"
|
||||||
|
cp -p "$SCODOC_DIR"/tools/etc/scodoc9.nginx "$slash"/etc/nginx/sites-available/ || die "can't copy nginx config"
|
||||||
|
# systemd
|
||||||
|
mkdir -p "$slash"/etc/systemd/system/ || die "can't mkdir systemd config"
|
||||||
|
cp -p "$SCODOC_DIR"/tools/etc/scodoc9.service "$slash"/etc/systemd/system/ || die "can't copy scodoc9.service"
|
||||||
|
|
||||||
|
# Répertoire DEBIAN
|
||||||
|
mv "$SCODOC_DIR"/tools/debian "$slash"/DEBIAN || die "can't install DEBIAN dir"
|
||||||
|
chmod 755 "$slash"/DEBIAN/*inst || die "can't chmod debian scripts"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -3,6 +3,9 @@
|
|||||||
# Pre-installation de scodoc
|
# Pre-installation de scodoc
|
||||||
|
|
||||||
# ------------ Safety checks
|
# ------------ Safety checks
|
||||||
|
# Version majeure de Debian (..., 9, 10)
|
||||||
|
debian_version=$(cat /etc/debian_version)
|
||||||
|
debian_version=${debian_version%%.*}
|
||||||
if [ "${debian_version}" != "11" ]
|
if [ "${debian_version}" != "11" ]
|
||||||
then
|
then
|
||||||
echo "Version du systeme Linux Debian incompatible"
|
echo "Version du systeme Linux Debian incompatible"
|
||||||
|
@ -1,76 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# INUTILE
|
|
||||||
XXX
|
|
||||||
|
|
||||||
# Préparation d'une release ScoDoc
|
|
||||||
# Download last git
|
|
||||||
source config.sh
|
|
||||||
source utils.sh
|
|
||||||
|
|
||||||
usage() {
|
|
||||||
echo $1 >&2
|
|
||||||
echo "Usage: $0 [-f] -v 9.x.y, where 9.x.y est le numéro de version créé" >&2
|
|
||||||
echo " -f: force release even if there's local changes" >&2
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
FORCE_RELEASE=0
|
|
||||||
while getopts "hfv:" opt; do
|
|
||||||
case $opt in
|
|
||||||
f)
|
|
||||||
FORCE_RELEASE=1
|
|
||||||
;;
|
|
||||||
v)
|
|
||||||
VERSION=$OPTARG
|
|
||||||
;;
|
|
||||||
h)
|
|
||||||
usage "Prépare une release"
|
|
||||||
;;
|
|
||||||
\?)
|
|
||||||
usage "Invalid option: -$OPTARG"
|
|
||||||
;;
|
|
||||||
:)
|
|
||||||
usage "Option -$OPTARG requires an argument."
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ -z "$VERSION" ]
|
|
||||||
then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
|
|
||||||
SOURCE_URL="https://scodoc.org/git/viennet/ScoDoc.git"
|
|
||||||
SOURCE_BRANCH="ScoDoc8"
|
|
||||||
RESULTFILE="scodoc-$VERSION.tgz"
|
|
||||||
|
|
||||||
if [ "$FORCE_RELEASE" -eq 0 ]
|
|
||||||
then
|
|
||||||
# Check local diffs, ignoring file modes (changed on VMs)
|
|
||||||
local_diffs=$(git -c core.fileMode=false status --porcelain --untracked-files=no | wc -l)
|
|
||||||
if [ "$local_diffs" -ne 0 ]
|
|
||||||
then
|
|
||||||
die "you have local diffs: git commit or stash before releasing"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Preparing release $VERSION"
|
|
||||||
|
|
||||||
mkdir "/tmp/$VERSION" || die "can't create directory /tmp/$VERSION"
|
|
||||||
cd "/tmp/$VERSION" || die "can't cd /tmp/$VERSION"
|
|
||||||
|
|
||||||
git clone "$SOURCE_URL" || die "git error cloning $SOURCE_URL"
|
|
||||||
cd ScoDoc || die "no ScoDoc directory !"
|
|
||||||
git checkout "$SOURCE_BRANCH" || die "git ckecking out branch $SOURCE_BRANCH"
|
|
||||||
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
# --- Archive
|
|
||||||
echo "Preparing archive..."
|
|
||||||
mv ScoDoc scodoc
|
|
||||||
chown -R scodoc scodoc
|
|
||||||
tar cfz "$RESULTFILE" scodoc
|
|
||||||
echo
|
|
||||||
echo "Release: $(pwd)/$RESULTFILE"
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user