예제 #1
0
	from DeployHelpers import deployWar

	archetypesFailed = False

	# Parse the arguments
	args = getArgs()

	wars = {}

	for archetype in archetypes:
		artifactId = "test-%s-%s" % (archetype, args.version.replace(".", "-"))
		try:
			log = getLogFile(archetype)
			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:
				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
		try:
			removeDir(artifactId)
		except:
			pass
		print("")
예제 #2
0
	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)
			mavenValidate(artifactId, logFile=log)	
			warFiles = copyWarFiles(artifactId, name=archetype)
			for war in warFiles:
				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
		try:
			removeDir(artifactId)
		except:
			pass
		print("")

	for i in wars:
예제 #3
0
    # Generate the required command line for archetype generation
    cmd = [mavenCmd, "archetype:generate"]
    cmd.append("-DarchetypeGroupId=%s" % (archetypeGroup))
    cmd.append("-DarchetypeArtifactId=%s" % (archetype))
    cmd.append("-DarchetypeVersion=%s" % (args.version))
    if hasattr(args, "archetype") and args.archetype != None:
        cmd.append("-DarchetypeRepository=%s" % (repo % (args.archetype)))
    cmd.append("-DgroupId=%s" % (group))
    cmd.append("-DartifactId=%s" % (artifactId))
    cmd.append("-Dversion=1.0-SNAPSHOT")
    cmd.append("-DinteractiveMode=false")

    # Generate pom.xml
    print("Generating pom.xml for archetype %s" % (archetype))
    subprocess.check_call(cmd, stdout=log)

    # Return the artifactId so we know the name in the future
    return artifactId


## DO THIS IF RUN AS A SCRIPT (not import) ##
if __name__ == "__main__":
    args = parseArgs()
    for archetype in archetypes:
        log = getLogFile(archetype)
        artifactId = generateArchetype(archetype)
        updateRepositories(artifactId)
        mavenValidate(artifactId, logFile=log)
        copyWarFiles(artifactId, name=archetype)
예제 #4
0
                pomXml, nameSpace = readPomFile(pom)
                for version in pomXml.getroot().findall("./{%s}version" % (nameSpace)):
                    args.version = version.text
    demosFailed = False
    ignoredDemos = args.ignore.split(",")

    for demo in demos:
        print("Validating demo %s" % (demo))
        try:
            repo = demos[demo]
            if isinstance(repo, tuple):
                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)
            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
            print("%s demo validation succeeded!" % (demo))
        except Exception as e:
            print("%s demo validation failed: %s" % (demo, e))
            if demo not in ignoredDemos:
                demosFailed = True
        removeDir(demo)
        print("")
예제 #5
0
	# Generate the required command line for archetype generation
	cmd = [mavenCmd, "archetype:generate"]
	cmd.append("-DarchetypeGroupId=%s" % (archetypeGroup))
	cmd.append("-DarchetypeArtifactId=%s" % (archetype))
	cmd.append("-DarchetypeVersion=%s" % (args.version))
	if hasattr(args, "archetype") and args.archetype != None:
		cmd.append("-DarchetypeRepository=%s" % (repo % (args.archetype)))
	cmd.append("-DgroupId=%s" % (group))
	cmd.append("-DartifactId=%s" % (artifactId))
	cmd.append("-Dversion=1.0-SNAPSHOT")
	cmd.append("-DinteractiveMode=false")
	
	# Generate pom.xml
	print("Generating pom.xml for archetype %s" % (archetype))
	subprocess.check_call(cmd, stdout=log)
	
	# Return the artifactId so we know the name in the future
	return artifactId

## DO THIS IF RUN AS A SCRIPT (not import) ##
if __name__ == "__main__":
	args = parseArgs()
	for archetype in archetypes:
		log = getLogFile(archetype)
		artifactId = generateArchetype(archetype)
		updateRepositories(artifactId)
		mavenValidate(artifactId, logFile=log)	
		copyWarFiles(artifactId, name=archetype)

예제 #6
0
    parser.add_argument("--ignore", type=str, help="Ignored demos", default="")
    args = getArgs()
    demosFailed = False
    ignoredDemos = args.ignore.split(",")
    wars = []

    for demo in demos:
        print("Validating demo %s" % (demo))
        try:
            repo = demos[demo]
            if (isinstance(repo, tuple)):
                checkout(demo, repo[0], repo[1])
            else:
                checkout(demo, 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))
            log_status("%s demo validation succeeded!" % (demo))
        except Exception as e:
            log_status("%s demo validation failed: %s" % (demo, e))
            if demo not in ignoredDemos:
                demosFailed = True
        except EnvironmentError as e:
            log_status("%s demo validation failed: %s" % (demo, e))
            if demo not in ignoredDemos:
                demosFailed = True
예제 #7
0
    from DeployHelpers import deployWar

    archetypesFailed = False

    # Parse the arguments
    args = getArgs()

    wars = {}

    for archetype in archetypes:
        artifactId = "test-%s-%s" % (archetype, args.version.replace(".", "-"))
        try:
            log = getLogFile(archetype)
            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:
                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
        try:
            removeDir(artifactId)
예제 #8
0
	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")

	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)
			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
		except Exception as e:
			print("Archetype %s build failed:" % (archetype), e)
			archetypesFailed = True
#		removeDir(artifactId)
		print("")
	if archetypesFailed:
		sys.exit(1)
예제 #9
0
                for version in pomXml.getroot().findall("./{%s}version" %
                                                        (nameSpace)):
                    args.version = version.text
    demosFailed = False
    ignoredDemos = args.ignore.split(",")

    for demo in demos:
        print("Validating demo %s" % (demo))
        try:
            repo = demos[demo]
            if (isinstance(repo, tuple)):
                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)
            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
            print("%s demo validation succeeded!" % (demo))
        except Exception as e:
            print("%s demo validation failed: %s" % (demo, e))
            if demo not in ignoredDemos:
                demosFailed = True
        removeDir(demo)
        print("")
예제 #10
0
	parser.add_argument("--ignore", type=str, help="Ignored demos", default="")
	args = getArgs()
	demosFailed = False
	ignoredDemos = args.ignore.split(",")
	wars = []

	for demo in demos:
		print("Validating demo %s" % (demo))
		try:
			repo = demos[demo]
			if (isinstance(repo, tuple)):
				checkout(demo, repo[0], repo[1])
			else:
				checkout(demo, 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))
			log_status("%s demo validation succeeded!" % (demo))
		except Exception as e:
			log_status("%s demo validation failed: %s" % (demo, e))
			if demo not in ignoredDemos:
				demosFailed = True
		except EnvironmentError as e:
			log_status("%s demo validation failed: %s" % (demo, e))
			if demo not in ignoredDemos:
				demosFailed = True
		try:
			removeDir(demo)
예제 #11
0
#version = VersionObject()
#version.version = "7.4.8"

# Uncomment lines before this, and comment following line to make a non-staging test
version = None

demos = {
	"dashboard" : "https://github.com/vaadin/dashboard-demo.git",
	"parking" : "https://github.com/vaadin/parking-demo.git",
	"addressbook" : "https://github.com/vaadin/addressbook.git",
	"confirmdialog" : "https://github.com/samie/Vaadin-ConfirmDialog.git"
}

def checkout(folder, url):
	Repo.clone_from(url, folder)

if __name__ == "__main__":
	if version is None:
		version = parseArgs()
	for demo in demos:
		print("Validating demo %s" % (demo))
		try:
			checkout(demo, demos[demo])
			updateRepositories(demo, repoIds = version)
			mavenValidate(demo, repoIds = version, logFile = getLogFile(demo))
			copyWarFiles(demo)
			print("%s demo validation succeeded!" % (demo))
		except:
			print("%s demo validation failed" % (demo))
		print("")
예제 #12
0
파일: BuildDemos.py 프로젝트: 2far/vaadin
                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)

    demosFailed = False

    for demo in demos:
        print("Validating demo %s" % (demo))
        try:
            checkout(demo, demos[demo])
            updateRepositories(demo)
            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
            print("%s demo validation succeeded!" % (demo))
        except Exception as e:
            print("%s demo validation failed: %s" % (demo, e))
            demosFailed = True
        removeDir(demo)
        print("")
    if demosFailed:
예제 #13
0
                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)

    demosFailed = False

    for demo in demos:
        print("Validating demo %s" % (demo))
        try:
            checkout(demo, demos[demo])
            updateRepositories(demo)
            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
            print("%s demo validation succeeded!" % (demo))
        except Exception as e:
            print("%s demo validation failed: %s" % (demo, e))
            demosFailed = True
        removeDir(demo)
        print("")
    if demosFailed: