Browse Source

Improve version number test for publish report script (#11007)

tags/8.5.0.beta1
Teemu Suo-Anttila 1 year ago
parent
commit
1dd3d0db1d
No account linked to committer's email address
1 changed files with 8 additions and 3 deletions
  1. 8
    3
      scripts/GeneratePublishReportPart1.py

+ 8
- 3
scripts/GeneratePublishReportPart1.py View File

@@ -14,8 +14,6 @@ metadataChecks = {
14 14
 	'https://vaadin.com/download/VERSIONS_7': '^7\..*',
15 15
 	'https://vaadin.com/download/release/7.7/LATEST': '^7\..*',
16 16
 	'https://vaadin.com/download/LATEST': '^6\..*',
17
-	'https://vaadin.com/download/LATEST8': '^8\.1\..*',
18
-	'https://vaadin.com/download/PRERELEASES': '^{ver}'
19 17
 }
20 18
 
21 19
 parser = argparse.ArgumentParser(description="Post-publish report generator")
@@ -37,10 +35,15 @@ elif not isdir(resultPath):
37 35
 	print("Result path is not a directory.")
38 36
 	sys.exit(1)
39 37
 
38
+# Latest 8 checks based on current version number.
40 39
 (major, minor, maintenance) = args.version.split(".", 2)
41 40
 prerelease = "." in maintenance
42 41
 if prerelease:
43 42
 	maintenance = maintenance.split('.')[0]
43
+	metadataChecks['https://vaadin.com/download/PRERELEASES'] = '^{ver}'
44
+	metadataChecks['https://vaadin.com/download/LATEST8'] = '^%d\.%d\..*' % (int(major), int(minor) - 1)
45
+else:
46
+	metadataChecks['https://vaadin.com/download/LATEST8'] = '^{ver}'
44 47
 
45 48
 def checkUrlContents(url, regexp):
46 49
 	r = requests.get(url)
@@ -52,7 +55,9 @@ def checkUrlStatus(url):
52 55
 
53 56
 metadataOk = True
54 57
 for url in metadataChecks:
55
-	metadataOk = metadataOk and checkUrlContents(url, metadataChecks[url].format(ver=args.version))
58
+	pattern = metadataChecks[url].format(ver=args.version)
59
+	print("Checking: %s with pattern %s" % (url, pattern))
60
+	metadataOk = metadataOk and checkUrlContents(url, pattern)
56 61
 
57 62
 tagOk = checkUrlStatus("https://github.com/vaadin/framework/releases/tag/{ver}".format(ver=args.version))
58 63
 

Loading…
Cancel
Save