aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <teemusa@vaadin.com>2015-07-10 14:50:00 +0300
committerTeemu Suo-Anttila <teemusa@vaadin.com>2015-07-10 14:50:00 +0300
commit8f74bb0faadda823c0d2f6180e6e37ed4c61def9 (patch)
tree18a3e3a380d56e9efc098866b8ed3b50071e212f
parent0c2e76d612f63691205aa21625890df3dc6e72f5 (diff)
downloadvaadin-framework-8f74bb0faadda823c0d2f6180e6e37ed4c61def9.tar.gz
vaadin-framework-8f74bb0faadda823c0d2f6180e6e37ed4c61def9.zip
Add staging report file generator
Change-Id: I8b4828317b4c7fe39d0cc71da79679998a0d472a
-rw-r--r--scripts/BuildArchetypes.py10
-rw-r--r--scripts/GenerateStagingReport.py40
2 files changed, 47 insertions, 3 deletions
diff --git a/scripts/BuildArchetypes.py b/scripts/BuildArchetypes.py
index 7fffaa7246..754c13a981 100644
--- a/scripts/BuildArchetypes.py
+++ b/scripts/BuildArchetypes.py
@@ -11,8 +11,6 @@
#
import subprocess, sys
-from BuildHelpers import mavenValidate, copyWarFiles, getLogFile, mavenCmd, updateRepositories, getArgs, removeDir, parser, resultPath
-from DeployHelpers import deployWar
from os.path import join
## DEFAULT VARIABLES ##
@@ -55,9 +53,15 @@ def generateArchetype(archetype, artifactId, repo):
# Generate pom.xml
print("Generating pom.xml for archetype %s" % (archetype))
subprocess.check_call(cmd, cwd=resultPath, stdout=log)
+
+def getDeploymentContext(archetype, version):
+ return "%s-%s" % (archetype.split("-", 2)[2], version)
## DO THIS IF RUN AS A SCRIPT (not import) ##
if __name__ == "__main__":
+ from BuildHelpers import mavenValidate, copyWarFiles, getLogFile, mavenCmd, updateRepositories, getArgs, removeDir, parser, resultPath
+ from DeployHelpers import deployWar
+
# Add command line arguments for staging repos
parser.add_argument("framework", type=int, help="Framework repo id (comvaadin-XXXX)", nargs='?')
parser.add_argument("archetype", type=int, help="Archetype repo id (comvaadin-XXXX)", nargs='?')
@@ -82,7 +86,7 @@ if __name__ == "__main__":
warFiles = copyWarFiles(artifactId, name=archetype)
for war in warFiles:
try:
- deployWar(war, "%s-%s.war" % (archetype.split("-", 2)[2], args.version))
+ deployWar(war, "%s.war" % (getDeploymentContext(archetype, args.version)))
except Exception as e:
print("War %s failed to deploy: %s" % (war, e))
archetypesFailed = True
diff --git a/scripts/GenerateStagingReport.py b/scripts/GenerateStagingReport.py
new file mode 100644
index 0000000000..aca37216ee
--- /dev/null
+++ b/scripts/GenerateStagingReport.py
@@ -0,0 +1,40 @@
+#coding=UTF-8
+
+from BuildArchetypes import archetypes, getDeploymentContext
+import argparse, cgi
+
+parser = argparse.ArgumentParser(description="Build report generator")
+parser.add_argument("version", type=str, help="Vaadin version that was just built")
+parser.add_argument("deployUrl", type=str, help="Base url of the deployment server")
+parser.add_argument("buildResultUrl", type=str, help="URL for the build result page")
+parser.add_argument("stagingRepo", type=str, help="URL for the staging repository")
+
+args = parser.parse_args()
+
+content = """<html>
+<head></head>
+<body>
+<table>
+"""
+
+content += "<tr><td>Try archetype demos<ul>"
+
+for archetype in archetypes:
+ content += "<li><a href='{url}/{context}'>{demo}</a></li>\n".format(url=args.deployUrl, demo=archetype, context=getDeploymentContext(archetype, args.version))
+
+content += """</ul></td></tr>
+<tr><td><a href="{repoUrl}">Staging repository</a></td></tr>
+<tr><td>Eclipse Ivy Settings:<br><pre>"""
+content += cgi.escape(""" <ibiblio name="vaadin-staging" usepoms="true" m2compatible="true"
+ root="{repoUrl}" />""".format(repoUrl=args.stagingRepo))
+content += """</pre>
+</td></tr>
+<tr><td><a href="https://dev.vaadin.com/milestone/Vaadin {version}">Trac Milestone</a></td></tr>
+<tr><td><a href="https://dev.vaadin.com/admin/ticket/versions">Add version {version} to Trac</td></tr>
+<tr><td><a href="{url}">Staging result page (See test results, pin and tag build and dependencies)</a></td></tr>
+</table>
+</body>
+</html>""".format(url=args.buildResultUrl, repoUrl=args.stagingRepo, version=args.version)
+
+f = open("result/report.html", 'w')
+f.write(content)