From 688c9cc7e870293b2770a89c6c21967126cc43b2 Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Tue, 19 Apr 2016 16:38:03 +0300 Subject: Combine build and staging report scripts Change-Id: I722a3311326160afed9ff23822d78b31115a9386 --- scripts/GenerateBuildReport.py | 77 +++++++++++++++++++++++++++++++++-- scripts/GenerateStagingReport.py | 88 ---------------------------------------- 2 files changed, 73 insertions(+), 92 deletions(-) delete mode 100644 scripts/GenerateStagingReport.py diff --git a/scripts/GenerateBuildReport.py b/scripts/GenerateBuildReport.py index eafdb39430..d0d4b556ae 100644 --- a/scripts/GenerateBuildReport.py +++ b/scripts/GenerateBuildReport.py @@ -1,19 +1,30 @@ #coding=UTF-8 +from BuildArchetypes import archetypes, getDeploymentContext from BuildDemos import demos -import argparse, subprocess +import argparse, subprocess, 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") +parser.add_argument("pluginRepo", type=str, help="URL for the maven plugin staging repository") +parser.add_argument("tbapiUrl", type=str, help="URL for the TestBench API build") + +parser.add_argument("frameworkRevision", type=str, default="[fill in framework repository revision]", nargs="?") +parser.add_argument("screenshotRevision", type=str, default="[fill in screenshot repository revision]", nargs="?") +parser.add_argument("archetypeRevision", type=str, default="[fill in maven-integration repository revision]", nargs="?") +parser.add_argument("mavenPluginRevision", type=str, default="[fill in maven-plugin repository revision]", nargs="?") + args = parser.parse_args() content = """ + @@ -26,7 +37,7 @@ content = """ try: p1 = subprocess.Popen(['find', '.', '-name', '*.java'], stdout=subprocess.PIPE) p2 = subprocess.Popen(['xargs', 'egrep', '-n', '@since ?$'], stdin=p1.stdout, stdout=subprocess.PIPE) - missing = subprocess.check_output(['egrep', '-v', '/(tests|result)/'], stdin=p2.stdout) + missing = subprocess.check_output(['egrep', '-v', '/(test|tests|target)/'], stdin=p2.stdout) content += "\n" % (missing) except subprocess.CalledProcessError as e: if e.returncode == 1: @@ -34,10 +45,68 @@ except subprocess.CalledProcessError as e: else: raise e -content += """ +content += """""".format(url=args.buildResultUrl) +content += "\n + + + + + + + + + + +

Checks that might need a second build

Create milestone for next release
Closed fixed tickets without milestone {version}
Closed tickets with milestone {version}
Empty @since:
\n
%s
Build result page (See test results, pin and tag build and dependencies)
Build result page (See test results, pin and tag build and dependencies)
Try demos
    " + +for demo in demos: + content += "
  • {demoName}
  • \n".format(url=args.deployUrl, demoName=demo, version=args.version) + +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
Maven Plugin Staging repository
Eclipse Ivy Settings:
""".format(repoUrl=args.stagingRepo, pluginRepoUrl=args.pluginRepo)
+content += cgi.escape("""	""".format(repoUrl=args.stagingRepo))
+content += """
+

Preparations before publishing

Close Trac Milestone
Verify pending release tickets still have milestone {version}
Add version {version} to Trac
Staging result page (See test results, pin and tag build and dependencies)
Commands to tag all repositories (warning: do not run as a single script but set variables and check before any push commands - this has not been tested yet and the change IDs are missing)
+    VERSION={version}
+    
+    GERRIT_USER=[fill in your gerrit username]
+    FRAMEWORK_REVISION={frameworkRevision}
+    SCREENSHOTS_REVISION={screenshotRevision}
+    ARCHETYPES_REVISION={archetypeRevision}
+    PLUGIN_REVISION={mavenPluginRevision}
+    
+    git clone ssh://$GERRIT_USER@dev.vaadin.com:29418/vaadin
+    cd vaadin
+    git tag -a -m"$VERSION" $VERSION $FRAMEWORK_REVISION
+    git push --tags
+    cd ..
+    
+    git clone ssh://$GERRIT_USER@dev.vaadin.com:29418/vaadin-screenshots
+    cd vaadin-screenshots
+    git tag -a -m"$VERSION" $VERSION $SCREENSHOTS_REVISION
+    git push --tags
+    cd ..
+    
+    git clone ssh://$GERRIT_USER@dev.vaadin.com:29418/maven-integration
+    cd maven-integration
+    git tag -a -m"$VERSION" $VERSION $ARCHETYPES_REVISION
+    git push --tags
+    cd ..
+    
+    git clone ssh://$GERRIT_USER@dev.vaadin.com:29418/maven-plugin
+    cd maven-plugin
+    git tag -a -m"$VERSION" $VERSION $PLUGIN_REVISION
+    git push --tags
+    cd ..
+    
Build and publish TestBench API for version {version} if proceeding
-""".format(url=args.buildResultUrl) +""".format(url=args.buildResultUrl, repoUrl=args.stagingRepo, version=args.version, tbapi=args.tbapiUrl, frameworkRevision=args.frameworkRevision, screenshotRevision=args.screenshotRevision, archetypeRevision=args.archetypeRevision, mavenPluginRevision=args.mavenPluginRevision) f = open("result/report.html", 'w') f.write(content) diff --git a/scripts/GenerateStagingReport.py b/scripts/GenerateStagingReport.py deleted file mode 100644 index 963967d28a..0000000000 --- a/scripts/GenerateStagingReport.py +++ /dev/null @@ -1,88 +0,0 @@ -#coding=UTF-8 - -from BuildArchetypes import archetypes, getDeploymentContext -from BuildDemos import demos -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") -parser.add_argument("tbapiUrl", type=str, help="URL for the TestBench API build") - -parser.add_argument("frameworkRevision", type=str, default="[fill in framework repository revision]", nargs="?") -parser.add_argument("screenshotRevision", type=str, default="[fill in screenshot repository revision]", nargs="?") -parser.add_argument("archetypeRevision", type=str, default="[fill in maven-integration repository revision]", nargs="?") -parser.add_argument("mavenPluginRevision", type=str, default="[fill in maven-plugin repository revision]", nargs="?") - -args = parser.parse_args() - -content = """ - - - -""" - -content += "\n - - - - - - - - - -
Try demos
    " - -for demo in demos: - content += "
  • {demoName}
  • \n".format(url=args.deployUrl, demoName=demo, version=args.version) - -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:
""".format(repoUrl=args.stagingRepo)
-content += cgi.escape("""	""".format(repoUrl=args.stagingRepo))
-content += """
-
Close Trac Milestone
Verify pending release tickets still have milestone {version}
Add version {version} to Trac
Staging result page (See test results, pin and tag build and dependencies)
Commands to tag all repositories (warning: do not run as a single script but set variables and check before any push commands - this has not been tested yet and the change IDs are missing)
-VERSION={version}
-
-GERRIT_USER=[fill in your gerrit username]
-FRAMEWORK_REVISION={frameworkRevision}
-SCREENSHOTS_REVISION={screenshotRevision}
-ARCHETYPES_REVISION={archetypeRevision}
-PLUGIN_REVISION={mavenPluginRevision}
-
-git clone ssh://$GERRIT_USER@dev.vaadin.com:29418/vaadin
-cd vaadin
-git tag -a -m"$VERSION" $VERSION $FRAMEWORK_REVISION
-git push --tags
-cd ..
-
-git clone ssh://$GERRIT_USER@dev.vaadin.com:29418/vaadin-screenshots
-cd vaadin-screenshots
-git tag -a -m"$VERSION" $VERSION $SCREENSHOTS_REVISION
-git push --tags
-cd ..
-
-git clone ssh://$GERRIT_USER@dev.vaadin.com:29418/maven-integration
-cd maven-integration
-git tag -a -m"$VERSION" $VERSION $ARCHETYPES_REVISION
-git push --tags
-cd ..
-
-git clone ssh://$GERRIT_USER@dev.vaadin.com:29418/maven-plugin
-cd maven-plugin
-git tag -a -m"$VERSION" $VERSION $PLUGIN_REVISION
-git push --tags
-cd ..
-
Build and publish TestBench API for version {version} if proceeding
- -""".format(url=args.buildResultUrl, repoUrl=args.stagingRepo, version=args.version, tbapi=args.tbapiUrl, frameworkRevision=args.frameworkRevision, screenshotRevision=args.screenshotRevision, archetypeRevision=args.archetypeRevision, mavenPluginRevision=args.mavenPluginRevision) - -f = open("result/report.html", 'w') -f.write(content) -- cgit v1.2.3