]> source.dussan.org Git - vaadin-framework.git/commitdiff
Add sampler to BuildDemos, support specifying branch for demo
authorTeemu Suo-Anttila <teemusa@vaadin.com>
Tue, 6 Oct 2015 10:13:14 +0000 (13:13 +0300)
committerTeemu Suo-Anttila <teemusa@vaadin.com>
Mon, 19 Oct 2015 11:17:32 +0000 (11:17 +0000)
New way to add a built demo with specified branch uses a tuple with
the format ("URL", "branch"). The given branch will be used when
cloning the demo. Default branch is master and is used if no branch
is provided.

Change-Id: I7b94f50045731a35ef6005e8fba160cfe0be4852

scripts/BuildDemos.py

index 451715f3c516b5144a901fdc9eb00c561809cc80..eef88db78f37f4f9ecc16e9381ce9f548d5ff883 100644 (file)
@@ -19,11 +19,13 @@ demos = {
        "dashboard" : "https://github.com/vaadin/dashboard-demo.git",
        "parking" : "https://github.com/vaadin/parking-demo.git",
        "addressbook" : "https://github.com/vaadin/addressbook.git",
-       "grid-gwt" : "https://github.com/vaadin/grid-gwt.git"
+       "grid-gwt" : "https://github.com/vaadin/grid-gwt.git",
+       "sampler" : "demos/sampler"
+#      "my-demo" : ("my_demo_url_or_path", "my-demo-dev-branch")
 }
 
-def checkout(folder, url):
-       Repo.clone_from(url, join(resultPath, folder))
+def checkout(folder, url, repoBranch = "master"):
+       Repo.clone_from(url, join(resultPath, folder), branch = repoBranch)
 
 if __name__ == "__main__":
        # Do imports.   
@@ -66,7 +68,11 @@ if __name__ == "__main__":
        for demo in demos:
                print("Validating demo %s" % (demo))
                try:
-                       checkout(demo, demos[demo])
+                       repo = demos[demo]
+                       if (isinstance(repo, tuple)):
+                               checkout(demo, repo[0], repo[1])
+                       else:
+                               checkout(demo, repo)
                        if hasattr(args, "repo") and args.repo is not None:
                                updateRepositories(join(resultPath, demo), args.repo)
                        mavenValidate(demo, logFile=getLogFile(demo))