summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/BuildArchetypes.py15
-rw-r--r--scripts/BuildDemos.py29
-rw-r--r--scripts/BuildHelpers.py11
-rw-r--r--scripts/DeployHelpers.py4
4 files changed, 20 insertions, 39 deletions
diff --git a/scripts/BuildArchetypes.py b/scripts/BuildArchetypes.py
index 98fe787d77..802e97c78c 100644
--- a/scripts/BuildArchetypes.py
+++ b/scripts/BuildArchetypes.py
@@ -41,7 +41,7 @@ def generateArchetype(archetype, artifactId, repo):
cmd.append("-DarchetypeGroupId=%s" % (archetypeGroup))
cmd.append("-DarchetypeArtifactId=%s" % (archetype))
cmd.append("-DarchetypeVersion=%s" % (args.version))
- if hasattr(args, "repo") and args.repo != None:
+ if repo is not None:
cmd.append("-DarchetypeRepository=%s" % repo)
cmd.append("-DgroupId=%s" % (group))
cmd.append("-DartifactId=%s" % (artifactId))
@@ -62,25 +62,22 @@ if __name__ == "__main__":
from BuildHelpers import mavenValidate, copyWarFiles, getLogFile, mavenCmd, updateRepositories, getArgs, removeDir, parser, resultPath
from DeployHelpers import deployWar
- # Add command line arguments for staging repos
- parser.add_argument("--repo", type=str, help="Staging repository URL", required=True)
-
archetypesFailed = False
# Parse the arguments
args = getArgs()
- if hasattr(args, "artifactPath") and args.artifactPath is not None:
- raise Exception("Archetype validation build does not support artifactPath")
-
wars = {}
for archetype in archetypes:
artifactId = "test-%s-%s" % (archetype, args.version.replace(".", "-"))
try:
log = getLogFile(archetype)
- generateArchetype(archetype, artifactId, args.repo)
- updateRepositories(join(resultPath, artifactId), args.repo)
+ generateArchetype(archetype, artifactId, args.pluginRepo)
+ if hasattr(args, "fwRepo") and args.fwRepo is not None:
+ updateRepositories(join(resultPath, artifactId), args.fwRepo)
+ if hasattr(args, "pluginRepo") and args.pluginRepo is not None:
+ updateRepositories(join(resultPath, artifactId), args.pluginRepo, postfix="plugin")
mavenValidate(artifactId, logFile=log)
warFiles = copyWarFiles(artifactId, name=archetype)
for war in warFiles:
diff --git a/scripts/BuildDemos.py b/scripts/BuildDemos.py
index 7099230339..59cfe88a81 100644
--- a/scripts/BuildDemos.py
+++ b/scripts/BuildDemos.py
@@ -36,32 +36,9 @@ if __name__ == "__main__":
sys.exit(1)
from BuildHelpers import updateRepositories, mavenValidate, copyWarFiles, getLogFile, removeDir, getArgs, mavenInstall, resultPath, readPomFile, parser
from DeployHelpers import deployWar
-
- # Add command line argument for staging repos
- parser.add_argument("--repo", type=str, help="Staging repository URL", default=None)
-
# Add command line agrument for ignoring failing demos
parser.add_argument("--ignore", type=str, help="Ignored demos", default="")
-
args = getArgs()
- if hasattr(args, "artifactPath") and args.artifactPath is not None:
- version = False
- basePath = args.artifactPath
- poms = []
- for root, dirs, files in os.walk(basePath):
- for name in files:
- if fnmatch(name, "*.pom"):
- poms.append(join(root, name))
- for pom in poms:
- jarFile = pom.replace(".pom", ".jar")
- if isfile(jarFile):
- mavenInstall(pom, jarFile)
- else:
- mavenInstall(pom)
- if "vaadin-server" in pom:
- pomXml, nameSpace = readPomFile(pom)
- for version in pomXml.getroot().findall("./{%s}version" % (nameSpace)):
- args.version = version.text
demosFailed = False
ignoredDemos = args.ignore.split(",")
@@ -75,8 +52,10 @@ if __name__ == "__main__":
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)
+ if hasattr(args, "fwRepo") and args.fwRepo is not None:
+ updateRepositories(join(resultPath, demo), args.fwRepo)
+ if hasattr(args, "pluginRepo") and args.pluginRepo is not None:
+ updateRepositories(join(resultPath, demo), args.pluginRepo, postfix="plugin")
mavenValidate(demo, logFile=getLogFile(demo))
wars.extend(copyWarFiles(demo))
print("%s demo validation succeeded!" % (demo))
diff --git a/scripts/BuildHelpers.py b/scripts/BuildHelpers.py
index 7545467f98..8f6e2dee60 100644
--- a/scripts/BuildHelpers.py
+++ b/scripts/BuildHelpers.py
@@ -25,9 +25,10 @@ args = None
parser = argparse.ArgumentParser(description="Automated staging validation")
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument("--version", help="Vaadin version to use")
-group.add_argument("--artifactPath", help="Path to local folder with Vaadin artifacts")
parser.add_argument("--maven", help="Additional maven command line parameters", default=None)
+parser.add_argument("--fwRepo", help="Framework staging repository URL", default=None)
+parser.add_argument("--pluginRepo", help="Maven plugin repository URL", default=None)
# Parse command line arguments <version>
def parseArgs():
@@ -109,7 +110,7 @@ def readPomFile(pomFile):
return ElementTree.parse(pomFile), nameSpace
# Recursive pom.xml update script
-def updateRepositories(path, repoUrl = None, version = None):
+def updateRepositories(path, repoUrl = None, version = None, postfix = "staging"):
# If versions are not supplied, parse arguments
if version is None:
version = getArgs().version
@@ -129,7 +130,7 @@ def updateRepositories(path, repoUrl = None, version = None):
print("Add staging repositories to " + pomXml)
# Add framework staging repository
- addRepo(repoNode, "repository", "vaadin-%s-staging" % (version), repoUrl)
+ addRepo(repoNode, "repository", "vaadin-%s-%s" % (version, postfix), repoUrl)
# Find the correct pluginRepositories node
pluginRepo = tree.getroot().find("{%s}pluginRepositories" % (nameSpace))
@@ -138,7 +139,7 @@ def updateRepositories(path, repoUrl = None, version = None):
pluginRepo = ElementTree.SubElement(tree.getroot(), "pluginRepositories")
# Add plugin staging repository
- addRepo(pluginRepo, "pluginRepository", "vaadin-%s-plugin-staging" % (version), repoUrl)
+ addRepo(pluginRepo, "pluginRepository", "vaadin-%s-%s" % (version, postfix), repoUrl)
# Overwrite the modified pom.xml
tree.write(pomXml, encoding='UTF-8')
@@ -147,7 +148,7 @@ def updateRepositories(path, repoUrl = None, version = None):
for i in listdir(path):
file = join(path, i)
if isdir(file):
- updateRepositories(join(path, i), repoUrl, version)
+ updateRepositories(join(path, i), repoUrl, version, postfix)
# Add a repository of repoType to given repoNode with id and URL
def addRepo(repoNode, repoType, id, url):
diff --git a/scripts/DeployHelpers.py b/scripts/DeployHelpers.py
index 12c7baaaec..038e187b8b 100644
--- a/scripts/DeployHelpers.py
+++ b/scripts/DeployHelpers.py
@@ -25,6 +25,10 @@ def testServer():
if serverUp is not None:
return serverUp
+ if getUrl() is None:
+ print("No deploy URL provided")
+ serverUp = False
+ return serverUp
print("Checking server status")
i = 0