]> source.dussan.org Git - vaadin-framework.git/commitdiff
Add optional --repo parameter for Demo validation script
authorTeemu Suo-Anttila <teemusa@vaadin.com>
Mon, 13 Jul 2015 10:44:41 +0000 (13:44 +0300)
committerVaadin Code Review <review@vaadin.com>
Mon, 13 Jul 2015 11:12:25 +0000 (11:12 +0000)
Change-Id: Id22fc2ef4acad52e91a18e4cc10bf73a9ab4d924

scripts/BuildDemos.py
scripts/BuildHelpers.py

index a13b5ac033ad15971d6a0a9e7b4a9dfa56c74b3b..ac161fc51722a995ec1dcb5a4596ba7508b2254b 100644 (file)
@@ -32,12 +32,16 @@ if __name__ == "__main__":
        except:
                print("BuildDemos depends on gitpython. Install it with `pip install gitpython`")
                sys.exit(1)
-       from BuildHelpers import updateRepositories, mavenValidate, copyWarFiles, getLogFile, removeDir, getArgs, mavenInstall, resultPath, readPomFile
+       from BuildHelpers import updateRepositories, mavenValidate, copyWarFiles, getLogFile, removeDir, getArgs, mavenInstall, resultPath, readPomFile, parser
        from DeployHelpers import deployWar
 
-       if hasattr(getArgs(), "artifactPath") and getArgs().artifactPath is not None:
+       # Add command line arguments for staging repos
+       parser.add_argument("--repo", type=str, help="Staging repository URL", default=None)
+
+       args = getArgs()
+       if hasattr(args, "artifactPath") and args.artifactPath is not None:
                version = False
-               basePath = getArgs().artifactPath
+               basePath = args.artifactPath
                poms = []
                for root, dirs, files in os.walk(basePath):
                        for name in files:
@@ -52,14 +56,15 @@ if __name__ == "__main__":
                        if "vaadin-server" in pom:
                                pomXml, nameSpace = readPomFile(pom)
                                for version in pomXml.getroot().findall("./{%s}version" % (nameSpace)):
-                                       getArgs().version = version.text
+                                       args.version = version.text
        demosFailed = False
        
        for demo in demos:
                print("Validating demo %s" % (demo))
                try:
                        checkout(demo, demos[demo])
-                       updateRepositories(demo)
+                       if hasattr(args, "repo") and args.repo is not None:
+                               updateRepositories(join(resultPath, demo), args.repo)
                        mavenValidate(demo, logFile=getLogFile(demo))
                        resultWars = copyWarFiles(demo)
                        for war in resultWars:
index cbcf8216328dfaad52f08986dcfdd589d7ffe581..7545467f98d4fca11e359d63f4b970a80fe65b08 100644 (file)
@@ -113,7 +113,7 @@ def updateRepositories(path, repoUrl = None, version = None):
        # If versions are not supplied, parse arguments
        if version is None:
                version = getArgs().version
-       
+
        # Read pom.xml
        pomXml = join(path, "pom.xml")
        if isfile(pomXml):