Example #1
0
 def testSuffix(self):
     self.assertTrue(
         functions.checkVersion('1.9.0+dev-264-g8de76b6e6', '1.8.0'))
Example #2
0
import functions

if not functions.is_tool("xz"):
	print ("missing dependency: xz")
	quit()

# Version from gitea site
current_version = requests.get(settings.gtsite).json()['version']
print ("current_version =", current_version)
# Get version tag from github and remove first char (v)
github_version_tag = requests.get(settings.gtgithubapiurl).json()['tag_name']
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 functions.checkVersion(github_version, current_version):


    # Stop systemd service
    print ("new version available, stopping service")
    os.system("systemctl stop gitea.service")

    # Should the new version be build from source?
    if settings.build_from_source:

        functions.buildFromSource(github_version_tag)

    else:
        # Set download url
        ## main file
        gtdownload = 'https://github.com/go-gitea/gitea/releases/download/'+github_version_tag+'/gitea-'+github_version+'-'+settings.gtsystem+'.xz'
Example #3
0
 def testInt(self):
     self.assertTrue(functions.checkVersion('9', '8'))
Example #4
0
 def testSameVersion(self):
     self.assertFalse(functions.checkVersion('1.9.7', '1.9.7'))
Example #5
0
 def testFalseVersion(self):
     self.assertFalse(functions.checkVersion('1.8.0', '1.9.0'))
Example #6
0
 def testTwoIntVersion(self):
     self.assertTrue(functions.checkVersion('1.10.0', '1.9.0'))
Example #7
0
 def testSimpleVersion(self):
     self.assertTrue(functions.checkVersion('1.9.1', '1.9.0'))