summaryrefslogtreecommitdiffstats
path: root/scripts/BuildHelpers.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/BuildHelpers.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/BuildHelpers.py')
-rw-r--r--scripts/BuildHelpers.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/scripts/BuildHelpers.py b/scripts/BuildHelpers.py
index be21c0f721..7349c9b367 100644
--- a/scripts/BuildHelpers.py
+++ b/scripts/BuildHelpers.py
@@ -6,7 +6,7 @@ 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 shutil import copy
+from shutil import copy, rmtree
from glob import glob
class VersionObject(object):
@@ -89,6 +89,7 @@ def mavenValidate(artifactId, mvnCmd = mavenCmd, logFile = sys.stdout, repoIds =
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")))
for warFile in warFiles:
@@ -97,7 +98,9 @@ def copyWarFiles(artifactId, resultDir = resultPath, name = None):
else:
deployName = "%s-%d.war" % (name, warFiles.index(warFile))
print("Copying .war file %s as %s to result folder" % (basename(warFile), deployName))
- copy(warFile, join(resultDir, "%s" % (deployName)))
+ copy(warFile, join(resultDir, deployName))
+ copiedWars.append(join(resultDir, deployName))
+ return copiedWars
# Recursive pom.xml update script
def updateRepositories(path, repoIds = None, repoUrl = repo):
@@ -158,3 +161,9 @@ def addRepo(repoNode, repoType, id, url):
# Get a logfile for given artifact
def getLogFile(artifact, resultDir = resultPath):
return open(join(resultDir, "%s.log" % (artifact)), 'w')
+
+def removeDir(subdir):
+ if '..' in subdir or '/' in subdir:
+ # Dangerous relative paths.
+ return
+ rmtree(join(getcwd(), subdir))