Adding upgrade step
This commit is contained in:
@@ -4,7 +4,9 @@
|
||||
## Installation of self hosted git service Gitea
|
||||
|
||||
toolName="gitea"
|
||||
giteaDownload="https://dl.gitea.io/gitea/1.8.1/gitea-1.8.1-linux-arm-6"
|
||||
giteaVersion="1.8.3"
|
||||
giteaDownload="https://dl.gitea.io/gitea/${giteaVersion}/gitea-${giteaVersion}-linux-arm-6"
|
||||
giteaLoc="/usr/local/bin/gitea"
|
||||
giteaService="https://raw.githubusercontent.com/go-gitea/gitea/master/contrib/systemd/gitea.service"
|
||||
giteaServiceLoc="/etc/systemd/system/gitea.service"
|
||||
|
||||
@@ -15,8 +17,7 @@ step_1() {
|
||||
|
||||
step_2_info() { echo "Downloading $toolName to user home: $giteaDownload"; }
|
||||
step_2() {
|
||||
exe cd ~
|
||||
exe wget -O gitea $giteaDownload
|
||||
exe wget -O ~/gitea $giteaDownload
|
||||
saveReturn $?
|
||||
endReturn
|
||||
}
|
||||
@@ -45,7 +46,7 @@ step_4() {
|
||||
exe chmod 770 /etc/gitea
|
||||
echo "Copying gitea to global location and making it executable"
|
||||
exe chmod +x ~/gitea
|
||||
exe cp ~/gitea /usr/local/bin/gitea
|
||||
exe cp ~/gitea "$giteaLoc"
|
||||
saveReturn $?
|
||||
endReturn
|
||||
}
|
||||
@@ -132,6 +133,17 @@ step_10() {
|
||||
exe mysql -u root -e 'FLUSH PRIVILEGES;'
|
||||
}
|
||||
|
||||
step_12_info() { echo "Download new version to /usr/local/bin"; }
|
||||
step_12_alias() { ALIAS="upgrade"; }
|
||||
step_12() {
|
||||
if [ -f "$giteaLoc" ] ; then
|
||||
echo "Backup existing executable first"
|
||||
return 1;
|
||||
fi
|
||||
exe wget -O "$giteaLoc" $giteaDownload
|
||||
exe chmod +x "$giteaLoc"
|
||||
}
|
||||
|
||||
step_20_info() { echo "Secure settings after installation"; }
|
||||
step_20() {
|
||||
exe chmod 750 /etc/gitea
|
||||
|
Reference in New Issue
Block a user