refactoring changes from sequpgrade (endReturn, ...) and some modernizations

This commit is contained in:
2023-01-03 15:49:08 +01:00
parent 215135e8aa
commit 3c22d5729f
69 changed files with 553 additions and 654 deletions

View File

@@ -44,9 +44,9 @@ step_1() {
step_2_info() { echo -e "Installing $toolName dependencies"; }
step_2() {
exe apt install "${toolPhpDeps[@]/#/${sq_phpName}-}" $toolDeps ${sq_aptOpt}
endReturn -o $? "Installing deps for $toolName failed"
endReturn "Installing deps for $toolName failed"
exe service ${sq_phpName}-fpm restart
endReturn -o $? "Problems starting $toolName"
endReturn "Problems starting $toolName"
}
step_3_info() { echo -e "Get $toolName using git"; }
@@ -63,7 +63,7 @@ step_4() {
exe cd "${toolPath:?}"
exe ${seq_origin:?}/composer.sh -qq install
exe sudo -u www-data ${sq_phpName:?} composer.phar install --no-ansi --no-interaction --optimize-autoloader
endReturn -o $? "Composer install error"
endReturn "Composer install error"
}
step_5_info() { echo "Create mysql database for $toolName"; }
@@ -97,10 +97,10 @@ step_7() {
step_8_info() { echo "Create pixelfed (horzion) service"; }
step_8() {
addConf -c "${horizonService}" "${horizonServiceLoc}"
endReturn -o $? "Failed to add horizon service"
endReturn "Failed to add horizon service"
exe systemctl daemon-reload
exe systemctl enable pixelfed.service
exe service pixelfed start
exe service pixelfed start
}
horizonServiceLoc="/etc/systemd/system/pixelfed.service"
horizonService="\
@@ -149,7 +149,7 @@ step_10() {
addConf -c "$lNginxConfig" "$nginxConfigLoc"
exe ln -s "$nginxConfigLoc" "$nginxConfigEnable"
exe nginx -t
endReturn -o $? "Nginx configuration check error"
endReturn "Nginx configuration check error"
exe service nginx restart
}
@@ -247,9 +247,9 @@ step_100_alias() { echo "upgrade"; }
step_100() {
exe cd ${toolPath:?}
exe git pull origin $toolTag
endReturn -o $? "git pull failed"
endReturn "git pull failed"
exe git checkout $toolTag
endReturn -o $? "git checkout failed"
endReturn "git checkout failed"
}
step_101_info() { echo "Recommended post update procedure"; }