Used sequpgrade.sh to upgrade existing seqs

This commit is contained in:
2022-05-29 20:58:23 +02:00
parent 10ee4198f0
commit 6214493c18
57 changed files with 802 additions and 806 deletions

View File

@@ -20,7 +20,7 @@ SCRIPT_NAME=${SCRIPT_FILE%%.*}
CONFIG_FILE_NAME="${SCRIPT_NAME}.cfg"
CONFIG_FILE_TEMPLATE="$WDIR/${CONFIG_FILE_NAME}.example"
step_config() {
seq_config() {
## or to use sequencer api with global config file:
initSeqConfig "$CONFIG_FILE_NAME" "$CONFIG_FILE_TEMPLATE"
if [ $? -eq 0 ] ; then
@@ -30,18 +30,18 @@ step_config() {
postgresPass="$MAYAN_DBPASS"
else
# End if no configuration file exists
[ $DRY -eq 0 ] && return -1
dry || return -1
fi
## Apt cmdline option to suppress user interaction
[ $QUIET -ne 0 ] && APTOPT="-y"
quiet && APTOPT="-y"
## Return of non zero value will abort the sequence
return 0
}
step_1_info() { echo "Install libreoffice without gui"; }
step_1_alias() { ALIAS="install"; }
step_1_alias() { echo "install"; }
step_1() {
exe apt update
exe apt --no-install-recommends install libreoffice -y
@@ -69,7 +69,7 @@ step_3() {
}
step_4_info() { echo "Create postgres database for $toolName"; }
step_4_alias() { ALIAS="createdb"; }
step_4_alias() { echo "createdb"; }
step_4() {
readDatabaseInfos
@@ -91,7 +91,7 @@ step_5() {
}
step_6_info() { echo "Supervisord configuration for $toolName"; }
step_6_alias() { ALIAS="supervisorconf"; }
step_6_alias() { echo "supervisorconf"; }
step_6() {
addConf -c "" "$supervisordConfLoc"
toolScript "platformtemplate supervisord > ${supervisordConfLoc}"
@@ -126,7 +126,7 @@ step_10_info() {
echoinfo " super : update also supervisor configuration"
echoinfo " (manual redis password update may be needed)"
}
step_10_alias() { ALIAS="upgrade"; }
step_10_alias() { echo "upgrade"; }
step_10() {
shift # don't need the step number
step upgradepip
@@ -149,12 +149,12 @@ uninstallRemovalsLoc="/tmp/removals.txt"
step_13_info() { echo "$toolName management script"; }
step_13_alias() { ALIAS="manage"; }
step_13_alias() { echo "manage"; }
step_13() {
shift
if [ -z "$1" ] || [ "$1" == "" ] ; then
echo -n "Command (empty for help): "
if [ $DRY != 0 ]; then
if dry; then
echo " dryrun"
else
read command
@@ -166,14 +166,14 @@ step_13() {
}
step_15_info() { echo "Upgrade python pip"; }
step_15_alias() { ALIAS="upgradepip"; }
step_15_alias() { echo "upgradepip"; }
step_15()
{
exe ${toolRoot}/bin/pip install --upgrade pip
}
step_20_info() { echo "Backup postgres database to media folder"; }
step_20_alias() { ALIAS="backupdb"; }
step_20_alias() { echo "backupdb"; }
step_20() {
local DELYEAR=$(($(date +%Y)-2))
if [ ! -s ~/.pgpass ] ; then
@@ -188,7 +188,7 @@ toolDbBackupFolder=${toolMediaFolder}/backupdb
step_22_info() { echo "Postgres database restore"; }
step_22_alias() { ALIAS="restoredb"; }
step_22_alias() { echo "restoredb"; }
step_22() {
echo " [I] Postgres database restore procedure"
echo "1. Create a empty postgres database first (step 4)"
@@ -218,7 +218,7 @@ readDatabaseInfos() {
read -s -p "Enter postgres password: " postgresPass
endCheckEmpty postgresPass "password"
fi
echoseq
info
}
# Needs readDatabaseInfos() to execute some commands
@@ -233,5 +233,5 @@ toolScript() {
${toolRoot}/bin/mayan-edms.py $*"
}
VERSION_SEQREV=15
readonly sqr_minVersion=16
. /usr/local/bin/sequencer.sh