コード例 #1
0
		cmd.extend(args.maven.strip('"').split(" "))
	
	# Generate pom.xml
	print("Generating pom.xml for archetype %s" % (archetype))
	subprocess.check_call(cmd, cwd=resultPath, stdout=log)

def getDeploymentContext(archetype, version):
	return "%s-%s" % (archetype.split("-", 2)[2], version)
	
## DO THIS IF RUN AS A SCRIPT (not import) ##
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)
コード例 #2
0
ファイル: BuildDemos.py プロジェクト: Maximenco-Ivan/vaadin

if __name__ == "__main__":
    # Do imports.
    try:
        from git import Repo
    except:
        log_status(
            "BuildDemos depends on gitpython. Install it with `pip install gitpython`"
        )
        dump_status(True)
        sys.exit(1)
    from BuildHelpers import updateRepositories, mavenValidate, copyWarFiles, getLogFile, removeDir, getArgs, mavenInstall, resultPath, readPomFile, parser
    from DeployHelpers import deployWar
    # Add command line agrument for ignoring failing demos
    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:
コード例 #3
0
ファイル: DeployHelpers.py プロジェクト: Scarlethue/vaadin
#coding=UTF-8

### Helper class for wildfly deployments. ###
# Related files $HOME/.deploy-url $HOME/.deploy-credentials

import sys, json
try:
	import requests
except Exception as e:
	print("DeployHelpers depends on requests library. Install it with `pip install requests`")
	sys.exit(1)
from requests.auth import HTTPDigestAuth
from os.path import join, expanduser, basename
from BuildHelpers import parser, getArgs

parser.add_argument("--deployUrl", help="Wildfly management URL")
parser.add_argument("--deployUser", help="Deployment user", default=None)
parser.add_argument("--deployPass", help="Deployment password", default=None)

# Helper for handling the full deployment
# name should end with .war
def deployWar(warFile, name=None):
	if name is None:
		name = basename(warFile).replace('.war', "-%s.war" % (getArgs().version.split('-')[0]))

	print("Deploying to context %s" % (name[:-4]))
	# Undeploy/Remove old version if needed
	if deploymentExists(name):
		removeDeployment(name)
	# Do upload war file
	hash = doUploadWarFile(warFile)
コード例 #4
0
ファイル: BuildDemos.py プロジェクト: huangjiasingle/vaadin
    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")
コード例 #5
0
ファイル: BuildDemos.py プロジェクト: DiegoCardoso/framework
def checkout(folder, url, repoBranch = "master"):
	Repo.clone_from(url, join(resultPath, folder), branch = repoBranch)

if __name__ == "__main__":
	# Do imports.
	try:
		from git import Repo
	except:
		log_status("BuildDemos depends on gitpython. Install it with `pip install gitpython`")
		dump_status(True)
		sys.exit(1)
	from BuildHelpers import mavenValidate, copyWarFiles, getLogFile, removeDir, getArgs, resultPath, parser, dockerWrap, generateArchetype
	from DeployHelpers import deployWar
	# Add command line agrument for ignoring failing demos
	parser.add_argument("--ignore", type=str, help="Ignored demos", default="")

	# Control to skip demos and archetypes
	parser.add_argument("--skipDemos", action="store_true", help="Skip building demos")
	parser.add_argument("--skipArchetypes", action="store_true", help="Skip building archetypes")

	args = getArgs()
	demosFailed = False
	ignoredDemos = args.ignore.split(",")
	wars = []

	if not args.skipDemos:
		for demo in demos:
			print("Validating demo %s" % (demo))
			try:
				repo = demos[demo]
コード例 #6
0

if __name__ == "__main__":
    # Do imports.
    try:
        from git import Repo
    except:
        log_status(
            "BuildDemos depends on gitpython. Install it with `pip install gitpython`"
        )
        dump_status(True)
        sys.exit(1)
    from BuildHelpers import mavenValidate, copyWarFiles, getLogFile, removeDir, getArgs, resultPath, parser, dockerWrap, generateArchetype
    from DeployHelpers import deployWar
    # Add command line agrument for ignoring failing demos
    parser.add_argument("--ignore", type=str, help="Ignored demos", default="")

    # Control to skip demos and archetypes
    parser.add_argument("--skipDemos",
                        action="store_true",
                        help="Skip building demos")
    parser.add_argument("--skipArchetypes",
                        action="store_true",
                        help="Skip building archetypes")

    args = getArgs()
    demosFailed = False
    ignoredDemos = args.ignore.split(",")
    wars = []

    if not args.skipDemos:
コード例 #7
0
ファイル: BuildDemos.py プロジェクト: wsdflink/vaadin
if __name__ == "__main__":
    # Do imports.
    try:
        from git import Repo
    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, 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:
コード例 #8
0
ファイル: BuildDemos.py プロジェクト: hariprasad108/framework
def checkout(folder, url, repoBranch = "master"):
	Repo.clone_from(url, join(resultPath, folder), branch = repoBranch)

if __name__ == "__main__":
	# Do imports.	
	try:
		from git import Repo
	except:
		log_status("BuildDemos depends on gitpython. Install it with `pip install gitpython`")
		dump_status(True)
		sys.exit(1)
	from BuildHelpers import updateRepositories, mavenValidate, copyWarFiles, getLogFile, removeDir, getArgs, mavenInstall, resultPath, readPomFile, parser, dockerWrap
	from DeployHelpers import deployWar
	# Add command line agrument for ignoring failing demos
	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)
コード例 #9
0
ファイル: BuildArchetypes.py プロジェクト: Scarlethue/vaadin
	cmd.append("-Dversion=1.0-SNAPSHOT")
	cmd.append("-DinteractiveMode=false")
	if hasattr(args, "maven") and args.maven is not None:
		cmd.extends(args.maven.split(" "))
	
	# Generate pom.xml
	print("Generating pom.xml for archetype %s" % (archetype))
	subprocess.check_call(cmd, cwd=resultPath, 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__":
	# Add command line arguments for staging repos
	parser.add_argument("framework", type=int, help="Framework repo id (comvaadin-XXXX)", nargs='?')
	parser.add_argument("archetype", type=int, help="Archetype repo id (comvaadin-XXXX)", nargs='?')
	parser.add_argument("plugin", type=int, help="Maven Plugin repo id (comvaadin-XXXX)", nargs='?')

	archetypesFailed = False

	# Parse the arguments
	args = getArgs()
	for archetype in archetypes:
		try:
			log = getLogFile(archetype)
			artifactId = generateArchetype(archetype)
			updateRepositories(artifactId)
			mavenValidate(artifactId, logFile=log)	
			warFiles = copyWarFiles(artifactId, name=archetype)
			for war in warFiles:
コード例 #10
0
ファイル: BuildArchetypes.py プロジェクト: 2far/vaadin
    cmd.append("-DinteractiveMode=false")
    if hasattr(args, "maven") and args.maven is not None:
        cmd.extends(args.maven.split(" "))

        # Generate pom.xml
    print("Generating pom.xml for archetype %s" % (archetype))
    subprocess.check_call(cmd, cwd=resultPath, 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__":
    # Add command line arguments for staging repos
    parser.add_argument("framework", type=int, help="Framework repo id (comvaadin-XXXX)", nargs="?")
    parser.add_argument("archetype", type=int, help="Archetype repo id (comvaadin-XXXX)", nargs="?")
    parser.add_argument("plugin", type=int, help="Maven Plugin repo id (comvaadin-XXXX)", nargs="?")

    archetypesFailed = False

    # Parse the arguments
    args = getArgs()
    for archetype in archetypes:
        try:
            log = getLogFile(archetype)
            artifactId = generateArchetype(archetype)
            updateRepositories(artifactId)
            mavenValidate(artifactId, logFile=log)
            warFiles = copyWarFiles(artifactId, name=archetype)
            for war in warFiles:
コード例 #11
0
def checkout(folder, url):
	Repo.clone_from(url, join(resultPath, folder))

if __name__ == "__main__":
	# Do imports.	
	try:
		from git import Repo
	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, resultPath, readPomFile, parser
	from DeployHelpers import deployWar

	# Add command line arguments for staging repos
	parser.add_argument("--repo", type=str, help="Staging repository URL", default=None)

	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: