diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2015-07-07 15:55:50 +0300 |
---|---|---|
committer | Teemu Suo-Anttila <teemusa@vaadin.com> | 2015-07-07 15:55:50 +0300 |
commit | 61fe18d7771b378bc5c5211276489127c35c96ee (patch) | |
tree | d064abf46ce4bb588355994205792926492084ec /scripts | |
parent | bd7f4bf17f9904a2f5e8e173aeda1d1f592982cc (diff) | |
download | vaadin-framework-61fe18d7771b378bc5c5211276489127c35c96ee.tar.gz vaadin-framework-61fe18d7771b378bc5c5211276489127c35c96ee.zip |
Fix demo auto validation script to add validated version to context
Change-Id: Ie30fe7f9c0c88de02f19a1bc0f377399a3568da4
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/BuildDemos.py | 4 | ||||
-rw-r--r-- | scripts/BuildHelpers.py | 15 | ||||
-rw-r--r-- | scripts/DeployHelpers.py | 2 |
3 files changed, 9 insertions, 12 deletions
diff --git a/scripts/BuildDemos.py b/scripts/BuildDemos.py index 721fec4c68..16f6990d4c 100644 --- a/scripts/BuildDemos.py +++ b/scripts/BuildDemos.py @@ -15,7 +15,7 @@ try: 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 +from BuildHelpers import updateRepositories, mavenValidate, copyWarFiles, getLogFile, removeDir, getArgs, mavenInstall, resultPath from DeployHelpers import deployWar from os.path import join, isfile from fnmatch import fnmatch @@ -29,7 +29,7 @@ demos = { } def checkout(folder, url): - Repo.clone_from(url, folder) + Repo.clone_from(url, join(resultPath, folder)) if __name__ == "__main__": if hasattr(getArgs(), "artifactPath") and getArgs().artifactPath is not None: diff --git a/scripts/BuildHelpers.py b/scripts/BuildHelpers.py index 4fe815fae1..f2872f66f9 100644 --- a/scripts/BuildHelpers.py +++ b/scripts/BuildHelpers.py @@ -5,19 +5,16 @@ import sys, argparse, subprocess, platform from xml.etree import ElementTree from os.path import join, isdir, isfile, basename, exists -from os import listdir, getcwd, mkdir +from os import listdir, mkdir from shutil import copy, rmtree from glob import glob -class VersionObject(object): - pass - # Staging repo base url repo = "http://oss.sonatype.org/content/repositories/comvaadin-%d" # Directory where the resulting war files are stored # TODO: deploy results -resultPath = "result" +resultPath = join("result", "demos") if not exists(resultPath): mkdir(resultPath) @@ -83,15 +80,15 @@ def mavenValidate(artifactId, mvnCmd = mavenCmd, logFile = sys.stdout, repoIds = cmd.extend(repoIds.maven.split(" ")) cmd.extend(["clean", "package", "validate"]) print("executing: %s" % (" ".join(cmd))) - subprocess.check_call(cmd, cwd=join(getcwd(), artifactId), stdout=logFile) + subprocess.check_call(cmd, cwd=join(resultPath, artifactId), stdout=logFile) # Collect .war files to given folder with given naming def copyWarFiles(artifactId, resultDir = resultPath, name = None): if name is None: name = artifactId copiedWars = [] - warFiles = glob(join(getcwd(), artifactId, "target", "*.war")) - warFiles.extend(glob(join(getcwd(), artifactId, "*", "target", "*.war"))) + warFiles = glob(join(resultDir, artifactId, "target", "*.war")) + warFiles.extend(glob(join(resultDir, artifactId, "*", "target", "*.war"))) for warFile in warFiles: if len(warFiles) == 1: deployName = "%s.war" % (name) @@ -166,7 +163,7 @@ def removeDir(subdir): if '..' in subdir or '/' in subdir: # Dangerous relative paths. return - rmtree(join(getcwd(), subdir)) + rmtree(join(resultPath, subdir)) def mavenInstall(pomFile, jarFile = None, mvnCmd = mavenCmd, logFile = sys.stdout): cmd = [mvnCmd, "install:install-file"] diff --git a/scripts/DeployHelpers.py b/scripts/DeployHelpers.py index e8e27b98b6..2c879088ff 100644 --- a/scripts/DeployHelpers.py +++ b/scripts/DeployHelpers.py @@ -21,7 +21,7 @@ parser.add_argument("--deployPass", help="Deployment password", default=None) # name should end with .war def deployWar(warFile, name=None): if name is None: - name = basename(warFile) + name = basename(warFile).replace('.war', "-%s.war" % (getArgs().version.split('-')[0])) print("Deploying to context %s" % (name[:-4])) # Undeploy/Remove old version if needed |