diff options
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 |