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

@@ -27,33 +27,33 @@ giteaDownFile="/tmp/giteaDown"
giteaUser="git"
versionNow=
step_config() {
seq_config() {
initSeqConfig "$CONFIG_FILE_NAME" "$CONFIG_FILE_TEMPLATE"
if [ $? -eq 0 ] ; then
CONFIG=1
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"
if [ -z $giteaVersion ] ; then
echoerr " [E] Couldn't determine latest version of $toolName"
error -e "Couldn't determine latest version of $toolName"
fi
[ ! -z "$(command -v gitea)" ] && versionNow=$(gitea --version | sed 's/.*version \([0-9.]\+\).*/\1/')
checkArchitecture
giteaIniLoc="${SEQ_GITEA_CONF_DIR}/app.ini"
echoseq " [I] Gitea work: $SEQ_GITEA_WORK_DIR"
echoseq " Gitea config: $SEQ_GITEA_CONF_DIR"
echoseq " Git user home: $SEQ_GITEA_HOME_DIR"
echoseq
outColor yellow
echoseq " [W] Don't forget to adapt $SEQ_GITEA_CONF_DIR/app.ini"
outColor
info "Gitea work: $SEQ_GITEA_WORK_DIR"
info " Gitea config: $SEQ_GITEA_CONF_DIR"
info " Git user home: $SEQ_GITEA_HOME_DIR"
info
color yellow
warning "Don't forget to adapt $SEQ_GITEA_CONF_DIR/app.ini"
color
## Return of non zero value will abort the sequence
return 0
@@ -69,7 +69,7 @@ checkArchitecture() {
}
step_1_info() { echo "Updating apt"; }
step_1_alias() { ALIAS="install"; }
step_1_alias() { echo "install"; }
step_1() {
exe apt update
}
@@ -106,9 +106,9 @@ step_4() {
"$SEQ_GITEA_HOME_DIR" "$SEQ_GITEA_WORK_DIR"/{custom,data,log}
exe chown root:$SEQ_GITEA_USER "$SEQ_GITEA_CONF_DIR"
exe chmod 770 $SEQ_GITEA_CONF_DIR
echoseq "Creating $giteaLogDir"
info "Creating $giteaLogDir"
exe install -g $SEQ_GITEA_USER -m 770 -d "$giteaLogDir"
echoseq -n "Copying gitea to global location and making it executable..."
info -n "Copying gitea to global location and making it executable..."
exe install -b -m 755 -T "$giteaDownFile" "$SEQ_GITEA_BIN_LOC" && echo "ok"
endReturn "Failed to install $SEQ_GITEA_BIN_LOC"
}
@@ -121,17 +121,17 @@ step_5() {
step_6_info() { echo "Starting $toolName service"; }
step_6() {
exe systemctl enable gitea --now
echoseq "Before proceeding to installation you may need to create a database first with step 10"
echoseq
echoseq "Goto http://[yourip]:3000/install and complete installation"
echoseq
echoseq "Afterwards please execute step 20 to secure configuration"
info "Before proceeding to installation you may need to create a database first with step 10"
info
info "Goto http://[yourip]:3000/install and complete installation"
info
info "Afterwards please execute step 20 to secure configuration"
}
step_7_info() { echo "Show configuration notes"; }
step_7_alias() { ALIAS="notes"; }
step_7_alias() { echo "notes"; }
step_7() {
outColor green
color green
cat <<NOTES_END
Final configuration notes for $giteaIniLoc:
@@ -173,7 +173,7 @@ step_12_info() {
echo "Upgrade existing $toolName installation"
fi
}
step_12_alias() { ALIAS="upgrade"; }
step_12_alias() { echo "upgrade"; }
step_12() {
endCheckEmpty versionNow "Please install $toolName first"
exe wget -O "$giteaDownFile" $giteaDownload
@@ -184,8 +184,8 @@ step_12() {
exe service gitea stop
saveReturn $?
endReturn
echoseq -n "Backing up existing executable to ${toolBackup}..."
exe cp -ar "$SEQ_GITEA_BIN_LOC" "$toolBackup" && echoseq "ok" || echoseq "nok"
info -n "Backing up existing executable to ${toolBackup}..."
exe cp -ar "$SEQ_GITEA_BIN_LOC" "$toolBackup" && info "ok" || info "nok"
fi
exe install --backup=none -m 755 -T "$giteaDownFile" "$SEQ_GITEA_BIN_LOC"
endReturn -o $? "Upgrade failed"
@@ -199,10 +199,10 @@ step_20() {
}
step_22_info() { echo "Open $toolName config file"; }
step_22_alias() { ALIAS="config"; }
step_22_alias() { echo "config"; }
step_22() {
exe vi "$giteaIniLoc"
}
VERSION_SEQREV=14
readonly sqr_minVersion=16
. /usr/local/bin/sequencer.sh