summaryrefslogtreecommitdiffstats
path: root/scripts/BuildDemos.py
diff options
context:
space:
mode:
authorHenri Sara <hesara@vaadin.com>2016-11-11 13:44:08 +0200
committerHenri Sara <hesara@vaadin.com>2016-11-11 13:44:08 +0200
commit4326b480ad11f23d8fc5941294af895716dc6427 (patch)
tree8475a237878826f99d3eec6996f237fc33cd90ec /scripts/BuildDemos.py
parent9a9d31c96b49e9c4d8341997e8765f3b010ada11 (diff)
downloadvaadin-framework-4326b480ad11f23d8fc5941294af895716dc6427.tar.gz
vaadin-framework-4326b480ad11f23d8fc5941294af895716dc6427.zip
Initial versions of the new release report scripts
These have been backported from Vaadin 8 branch with minimal modifications. Change-Id: I292917aa0457c69b569313a3e56913b4a8d85316
Diffstat (limited to 'scripts/BuildDemos.py')
-rw-r--r--scripts/BuildDemos.py32
1 files changed, 23 insertions, 9 deletions
diff --git a/scripts/BuildDemos.py b/scripts/BuildDemos.py
index 6f46add374..26c73a25e9 100644
--- a/scripts/BuildDemos.py
+++ b/scripts/BuildDemos.py
@@ -3,13 +3,13 @@
# See BuildArchetypes for details on environment
# BuildDemos needs git in PATH and depends on gitpython library
# gitpython can be installed with python installer script "pip":
-# pip install gitpython
+# pip install gitpython
#
# Deployment dependency: requests
# pip install requests
# Deploy depends on .deployUrl and .deployCredentials files in home folder
-import sys, os
+import sys, os, pickle
from os.path import join, isfile
from fnmatch import fnmatch
from xml.etree.ElementTree import ElementTree
@@ -24,15 +24,26 @@ demos = {
# "my-demo" : ("my_demo_url_or_path", "my-demo-dev-branch")
}
+status_dump = {"messages": []}
+
+def dump_status(error_occurred):
+ status_dump["error"] = error_occurred
+ pickle.dump(status_dump, open("result/demo_validation_status.pickle", "wb"))
+
+def log_status(log_string):
+ status_dump["messages"].add(log_string)
+ print(log_string)
+
def checkout(folder, url, repoBranch = "master"):
Repo.clone_from(url, join(resultPath, folder), branch = repoBranch)
if __name__ == "__main__":
- # Do imports.
+ # Do imports.
try:
from git import Repo
except:
- print("BuildDemos depends on gitpython. Install it with `pip install gitpython`")
+ log_status("BuildDemos depends on gitpython. Install it with `pip install gitpython`")
+ dump_status(True)
sys.exit(1)
from BuildHelpers import updateRepositories, mavenValidate, copyWarFiles, getLogFile, removeDir, getArgs, mavenInstall, resultPath, readPomFile, parser
from DeployHelpers import deployWar
@@ -41,7 +52,7 @@ if __name__ == "__main__":
args = getArgs()
demosFailed = False
ignoredDemos = args.ignore.split(",")
-
+
wars = []
for demo in demos:
@@ -58,13 +69,13 @@ if __name__ == "__main__":
updateRepositories(join(resultPath, demo), args.pluginRepo, postfix="plugin")
mavenValidate(demo, logFile=getLogFile(demo))
wars.extend(copyWarFiles(demo))
- print("%s demo validation succeeded!" % (demo))
+ log_status("%s demo validation succeeded!" % (demo))
except Exception as e:
- print("%s demo validation failed: %s" % (demo, e))
+ log_status("%s demo validation failed: %s" % (demo, e))
if demo not in ignoredDemos:
demosFailed = True
except EnvironmentError as e:
- print("%s demo validation failed: %s" % (demo, e))
+ log_status("%s demo validation failed: %s" % (demo, e))
if demo not in ignoredDemos:
demosFailed = True
try:
@@ -77,8 +88,11 @@ if __name__ == "__main__":
try:
deployWar(war)
except Exception as e:
- print("War %s failed to deploy: %s" % (war, e))
+ log_status("War %s failed to deploy: %s" % (war, e))
demosFailed = True
if demosFailed:
+ dump_status(True)
sys.exit(1)
+
+ dump_status(False)