@@ -27,31 +27,31 @@ function update_script() {
2727 msg_error " No ${APP} Installation Found!"
2828 exit
2929 fi
30- GITHUB_RELEASE=$( curl -fsSL https://api.github.com/repos/theonedev/onedev/releases/latest | grep " tag_name" | awk ' {print substr($2, 3, length($2)-4) }' )
31- if [[ ! -f /opt/${APP} _version.txt ]] || [[ " ${GITHUB_RELEASE} " != " $( cat /opt/${APP} _version.txt) " ]]; then
30+
31+ if check_for_gh_release " onedev" " theonedev/onedev" ; then
32+
33+ JAVA_VERSION=" 21" setup_java
34+
3235 msg_info " Stopping Service"
3336 systemctl stop onedev
3437 msg_ok " Stopped Service"
3538
36- msg_info " Updating ${APP} to v ${GITHUB_RELEASE} "
39+ msg_info " Updating OneDev "
3740 cd /opt
38- curl -fsSL " https://code.onedev.io/onedev/server/~site/onedev-latest.tar.gz" -o $( basename " https://code. onedev.io/onedev/server/~site/onedev -latest.tar.gz" )
41+ curl -fsSL " https://code.onedev.io/onedev/server/~site/onedev-latest.tar.gz" -o onedev-latest.tar.gz
3942 tar -xzf onedev-latest.tar.gz
4043 $STD /opt/onedev-latest/bin/upgrade.sh /opt/onedev
41- RELEASE=$( cat /opt/onedev/release.properties | grep " version" | cut -d' =' -f2)
4244 rm -rf /opt/onedev-latest
4345 rm -rf /opt/onedev-latest.tar.gz
44- echo " ${RELEASE } " > " /opt/ ${APP} _version.txt "
45- msg_ok " Updated ${APP} to v ${RELEASE} "
46+ echo " ${CHECK_UPDATE_RELEASE } " > ~/.onedev
47+ msg_ok " Updated OneDev "
4648
4749 msg_info " Starting Service"
4850 systemctl start onedev
4951 msg_ok " Started Service"
5052 msg_ok " Updated successfully!"
51- else
52- msg_ok " No update required. ${APP} is already at v${RELEASE} ."
53+ exit
5354 fi
54- exit
5555}
5656
5757start
0 commit comments