Automatically backup current gitea binary

Bump to gitea version 1.9.4
This commit is contained in:
2019-10-09 09:45:28 +02:00
parent f126f9e1df
commit 9a6901ee95

View File

@@ -4,9 +4,10 @@
## Installation of self hosted git service Gitea ## Installation of self hosted git service Gitea
toolName="gitea" toolName="gitea"
giteaVersion="1.9.3" giteaVersion="1.9.4"
giteaDownload="https://dl.gitea.io/gitea/${giteaVersion}/gitea-${giteaVersion}-linux-arm-6" giteaDownload="https://dl.gitea.io/gitea/${giteaVersion}/gitea-${giteaVersion}-linux-arm-6"
giteaLoc="/usr/local/bin/gitea" giteaDir="/usr/local/bin"
giteaLoc="${giteaDir}/gitea"
giteaService="https://raw.githubusercontent.com/go-gitea/gitea/master/contrib/systemd/gitea.service" giteaService="https://raw.githubusercontent.com/go-gitea/gitea/master/contrib/systemd/gitea.service"
giteaServiceLoc="/etc/systemd/system/gitea.service" giteaServiceLoc="/etc/systemd/system/gitea.service"
@@ -137,11 +138,17 @@ step_12_info() { echo "Download new version to /usr/local/bin"; }
step_12_alias() { ALIAS="upgrade"; } step_12_alias() { ALIAS="upgrade"; }
step_12() { step_12() {
if [ -f "$giteaLoc" ] ; then if [ -f "$giteaLoc" ] ; then
echo "Backup existing executable first" local versionNow=$(gitea --version | sed 's/.*version \([0-9.]\+\).*/\1/')
return 1; local toolBackup="${giteaDir}/gitea_${versionNow}"
exe service gitea stop
saveReturn $?
endReturn
echo -n "Backuping up existing executable to ${toolBackup}..."
exe cp -ar "$giteaLoc" "$toolBackup" && echo "ok"
fi fi
exe wget -O "$giteaLoc" $giteaDownload exe wget -O "$giteaLoc" $giteaDownload
exe chmod +x "$giteaLoc" exe chmod +x "$giteaLoc"
exe service gitea start
} }
step_20_info() { echo "Secure settings after installation"; } step_20_info() { echo "Secure settings after installation"; }