From f50b536d99cae402a604550a3493f111bab955da Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Wed, 10 Jun 2015 13:45:09 +0300 Subject: Add python script for validating demos This patch refactors most of building logic from BuildArchetypes.py to BuildHelpers.py Change-Id: I34526db0cc2dba3b0dc6afddefa7559b5e75b87c --- scripts/BuildDemos.py | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 scripts/BuildDemos.py (limited to 'scripts/BuildDemos.py') 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("") -- cgit v1.2.3