Browse Source

Fix demo and archetype build scripts to deploy all wars at once

Change-Id: I5ddf43d0c895404abf2139c847ac805ef08452c8
tags/7.7.0.alpha1
Teemu Suo-Anttila 8 years ago
parent
commit
1147faa895
2 changed files with 27 additions and 13 deletions
  1. 16
    6
      scripts/BuildArchetypes.py
  2. 11
    7
      scripts/BuildDemos.py

+ 16
- 6
scripts/BuildArchetypes.py View File

@@ -73,6 +73,8 @@ if __name__ == "__main__":
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:
@@ -82,15 +84,23 @@ if __name__ == "__main__":
mavenValidate(artifactId, logFile=log)
warFiles = copyWarFiles(artifactId, name=archetype)
for war in warFiles:
try:
deployWar(war, "%s.war" % (getDeploymentContext(archetype, args.version)))
except Exception as e:
print("War %s failed to deploy: %s" % (war, e))
archetypesFailed = True
wars[war] = "%s.war" % (getDeploymentContext(archetype, args.version))
print("%s validation succeeded!" % (archetype))
except Exception as e:
print("Archetype %s build failed:" % (archetype), e)
archetypesFailed = True
# removeDir(artifactId)
try:
removeDir(artifactId)
except:
pass
print("")

for i in wars:
try:
deployWar(i, wars[i])
except Exception as e:
print("War %s failed to deploy: %s" % (war, e))
archetypesFailed = True

if archetypesFailed:
sys.exit(1)

+ 11
- 7
scripts/BuildDemos.py View File

@@ -65,6 +65,8 @@ if __name__ == "__main__":
demosFailed = False
ignoredDemos = args.ignore.split(",")
wars = []

for demo in demos:
print("Validating demo %s" % (demo))
try:
@@ -76,13 +78,7 @@ if __name__ == "__main__":
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:
try:
deployWar(war)
except Exception as e:
print("War %s failed to deploy: %s" % (war, e))
demosFailed = True
wars.extend(copyWarFiles(demo))
print("%s demo validation succeeded!" % (demo))
except Exception as e:
print("%s demo validation failed: %s" % (demo, e))
@@ -97,5 +93,13 @@ if __name__ == "__main__":
except:
pass
print("")

for war in wars:
try:
deployWar(war)
except Exception as e:
print("War %s failed to deploy: %s" % (war, e))
demosFailed = True

if demosFailed:
sys.exit(1)

Loading…
Cancel
Save