summaryrefslogtreecommitdiffstats
path: root/scripts/BuildDemos.py
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <teemusa@vaadin.com>2015-06-10 13:45:09 +0300
committerVaadin Code Review <review@vaadin.com>2015-06-11 13:18:38 +0000
commitf50b536d99cae402a604550a3493f111bab955da (patch)
treec3bc6371717317a28f474331cc98d770637ad4a9 /scripts/BuildDemos.py
parenteb6e79a5e489c9f030e08344df40d1e8df217859 (diff)
downloadvaadin-framework-f50b536d99cae402a604550a3493f111bab955da.tar.gz
vaadin-framework-f50b536d99cae402a604550a3493f111bab955da.zip
Add python script for validating demos
This patch refactors most of building logic from BuildArchetypes.py to BuildHelpers.py Change-Id: I34526db0cc2dba3b0dc6afddefa7559b5e75b87c
Diffstat (limited to 'scripts/BuildDemos.py')
-rw-r--r--scripts/BuildDemos.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/scripts/BuildDemos.py b/scripts/BuildDemos.py
new file mode 100644
index 0000000000..f9f2ed1b48
--- /dev/null
+++ b/scripts/BuildDemos.py
@@ -0,0 +1,41 @@
+#coding=UTF-8
+
+# 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
+
+from git import Repo
+from BuildHelpers import updateRepositories, mavenValidate, copyWarFiles, VersionObject, getLogFile, parseArgs
+
+## Example of a non-staging test.
+#version = VersionObject()
+#version.version = "7.4.8"
+
+# Uncomment lines before this, and comment following line to make a non-staging test
+version = None
+
+demos = {
+ "dashboard" : "https://github.com/vaadin/dashboard-demo.git",
+ "parking" : "https://github.com/vaadin/parking-demo.git",
+ "addressbook" : "https://github.com/vaadin/addressbook.git",
+ "confirmdialog" : "https://github.com/samie/Vaadin-ConfirmDialog.git"
+}
+
+def checkout(folder, url):
+ Repo.clone_from(url, folder)
+
+if __name__ == "__main__":
+ if version is None:
+ version = parseArgs()
+ for demo in demos:
+ print("Validating demo %s" % (demo))
+ try:
+ checkout(demo, demos[demo])
+ updateRepositories(demo, repoIds = version)
+ mavenValidate(demo, repoIds = version, logFile = getLogFile(demo))
+ copyWarFiles(demo)
+ print("%s demo validation succeeded!" % (demo))
+ except:
+ print("%s demo validation failed" % (demo))
+ print("")