summaryrefslogtreecommitdiffstats
path: root/scripts/BuildDemos.py
blob: f9f2ed1b48d95ba919c67ebb3bd2859f0b42b97c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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("")