summaryrefslogtreecommitdiffstats
path: root/scripts/BuildDemos.py
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <teemusa@vaadin.com>2015-06-12 11:23:39 +0300
committerVaadin Code Review <review@vaadin.com>2015-07-07 10:10:46 +0000
commit771da038480192a2d49a3672a33850ec3f8e3269 (patch)
treeba6fd711656e343e416771dfe9534f75b031335a /scripts/BuildDemos.py
parent73d4e770751a3d78f9f177c82b2aa8c7281ec77f (diff)
downloadvaadin-framework-771da038480192a2d49a3672a33850ec3f8e3269.tar.gz
vaadin-framework-771da038480192a2d49a3672a33850ec3f8e3269.zip
Add DeployHelpers python module for adding wildfly auto deployment
Change-Id: I1b3570a96d8406aa502171eb8065f1359d458450
Diffstat (limited to 'scripts/BuildDemos.py')
-rw-r--r--scripts/BuildDemos.py39
1 files changed, 24 insertions, 15 deletions
diff --git a/scripts/BuildDemos.py b/scripts/BuildDemos.py
index f9f2ed1b48..396863350d 100644
--- a/scripts/BuildDemos.py
+++ b/scripts/BuildDemos.py
@@ -4,38 +4,47 @@
# BuildDemos needs git in PATH and depends on gitpython library
# gitpython can be installed with python installer script "pip":
# pip install gitpython
+#
+# Deployment dependency: requests
+# pip install requests
+# Deploy depends on .deployUrl and .deployCredentials files in home folder
-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
+import sys
+try:
+ from git import Repo
+except:
+ print("BuildDemos depends on gitpython. Install it with `pip install gitpython`")
+ sys.exit(1)
+from BuildHelpers import updateRepositories, mavenValidate, copyWarFiles, getLogFile, removeDir
+from DeployHelpers import deployWar
+# Validated demos. name -> git url
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"
+ "confirmdialog" : "https://github.com/samie/Vaadin-ConfirmDialog.git",
+ "grid-gwt" : "https://github.com/vaadin/grid-gwt.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)
+ updateRepositories(demo)
+ mavenValidate(demo, logFile=getLogFile(demo))
+ resultWars = copyWarFiles(demo)
+ for war in resultWars:
+ try:
+ deployWar(war)
+ except Exception as e:
+ print("War %s failed to deploy: %s" % (war, e))
print("%s demo validation succeeded!" % (demo))
except:
print("%s demo validation failed" % (demo))
+ removeDir(demo)
print("")