From 8f74bb0faadda823c0d2f6180e6e37ed4c61def9 Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Fri, 10 Jul 2015 14:50:00 +0300 Subject: Add staging report file generator Change-Id: I8b4828317b4c7fe39d0cc71da79679998a0d472a --- scripts/BuildArchetypes.py | 10 +++++++--- scripts/GenerateStagingReport.py | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 scripts/GenerateStagingReport.py (limited to 'scripts') 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 = """ + + + +""" + +content += " + + + + + +
Try archetype demos
    " + +for archetype in archetypes: + content += "
  • {demo}
  • \n".format(url=args.deployUrl, demo=archetype, context=getDeploymentContext(archetype, args.version)) + +content += """
Staging repository
Eclipse Ivy Settings:
"""
+content += cgi.escape("""	""".format(repoUrl=args.stagingRepo))
+content += """
+
Trac Milestone
Add version {version} to Trac
Staging result page (See test results, pin and tag build and dependencies)
+ +""".format(url=args.buildResultUrl, repoUrl=args.stagingRepo, version=args.version) + +f = open("result/report.html", 'w') +f.write(content) -- cgit v1.2.3