1
0
mirror of https://github.com/CMiksche/gitea-auto-update synced 2025-12-11 08:27:23 +01:00

Merge branch 'master' of github.com:CMiksche/gitea-auto-update

This commit is contained in:
Eideen
2019-05-19 12:35:36 +02:00
3 changed files with 71 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ License: GNU General Public License
import settings
import requests
import os
<<<<<<< HEAD
# Function to download a file
@@ -35,6 +36,9 @@ def buildFromSource(tag):
os.system('TAGS="bindata sqlite sqlite_unlock_notify" make generate build')
# Move binary
os.system("mv gitea "+settings.gtfile)
=======
import functions
>>>>>>> 38e9451f8a230c9110e7b43f34cd64f375858f71
def is_tool(name):
##Check whether `name` is on PATH and marked as executable.
@@ -57,7 +61,7 @@ print ("github_version_tag =", github_version_tag)
# Get version from version tag
github_version = github_version_tag[1:]
# Check if there is a new version
if github_version > current_version:
if functions.checkVersion(github_version, current_version):
# Stop systemd service
@@ -67,7 +71,7 @@ if github_version > current_version:
# Should the new version be build from source?
if settings.build_from_source:
buildFromSource(github_version_tag)
functions.buildFromSource(github_version_tag)
else:
# Set download url
@@ -79,6 +83,7 @@ if github_version > current_version:
print (shadownload)
# Download file
<<<<<<< HEAD
## downloading sha
print ("downloading sha256 hashsum")
@@ -105,6 +110,9 @@ if github_version > current_version:
else:
print ("error")
quit()
=======
functions.download(gtdownload, settings.gtfile)
>>>>>>> 38e9451f8a230c9110e7b43f34cd64f375858f71
# Start systemd service
print ("starting gitea.service")