예제 #1
0
def install_profile_app(apps='',ext='tar.gz',profile=''):
	if apps == '':
		print (red('You must give me a list of the tomcat apps through the gap for the deploy.'))
		exit()

	if not profile and profile == '':
		profile=prompt('What a name of the profile of the tomcat applications do you want?', default='')

	apps=apps.split(' ')

	# set path
	templates_path=common.get_templates(path='/tmp/tomcat/profiles')
	install_path=common.get_install(path='/var/lib/tomcat7')

	if not files.exists(templates_path):
		print(red('The path '+templates_path+' to the tomcat applications isn\'t exists'))
		exit()

	for app in apps:
		if files.exists(templates_path+'/'+profile+'.'+ext):
			run('cp '+templates_path+'/'+profile+'.'+ext+' '+install_path+'/'+app+'/webapps/'+app)
			with cd(install_path+'/'+app+'/webapps/'+app+''):
				with prefix('tar -xzf '+profile+'.'+ext):
					run('rm -f '+profile+'.'+ext)
		else:
			print(red('The path to the profile \''+profile+'\' of the tomcat\'s application \''+app+'\' isn\'t exists'))
예제 #2
0
def get_client_interfaces(interfaces=''):
    if interfaces == '':
        print(
            red('You must give me a list of interfaces through the gap for the deploy.'
                ))
        exit()

    interfaces = interfaces.split(' ')

    # check share
    if 'share' not in interfaces:
        print(red('You must give the interface - share, too'))
        exit()

    # set path
    templates_path = common.get_templates(path='templates/web-interfaces')

    for interface in interfaces:
        if os.path.exists(templates_path + '/' + interface):
            local('test -d ' + templates_path + '/' + interface + ' && cd ' +
                  templates_path + ' && rm -rf ./' + interface)

        if interface == 'vcc':
            local('git clone -b teligent [email protected]:/webstroy/' +
                  interface + '-teligent.git ' + templates_path + '/' +
                  interface + '')
        else:
            local('git clone [email protected]:/webstroy/' + interface +
                  '-teligent.git ' + templates_path + '/' + interface + '')
예제 #3
0
def install_tomcat_apps(apps='',ext='war'):
	if apps == '':
		print (red('You must give me a list of the tomcat apps through the gap for the deploy.'))
		exit()

	apps=apps.split(' ')

	# set path
	templates_path=common.get_templates(path='/tmp/tomcat')
	install_path=common.get_install(path='/var/lib/tomcat7')

	if not files.exists(templates_path):
		print(red('The path '+templates_path+' to the tomcat applications on the '+env.host_string+' isn\'t exists'))
		exit()

	for app in apps:
		if files.exists(templates_path+'/'+app+'.'+ext):
			if not files.exists(install_path+'/'+app+'/webapps/'+app):
				run('mkdir '+install_path+'/'+app+'/webapps/'+app)
				run('cp '+templates_path+'/'+app+'.'+ext+' '+install_path+'/'+app+'/webapps/'+app)
				with cd(install_path+'/'+app+'/webapps/'+app):
					if files.exists('/usr/bin/unzip'):
						run('unzip '+app+'.'+ext)
						run('rm -f '+app+'.'+ext)
					else:
						print(red('You must install the unzip on the '+env.host_string))
						exit()
		else:
			print(red('The path to the tomcat\'s application \''+app+'\' isn\'t exists'))
예제 #4
0
def put_client_interfaces(interfaces=''):
    if interfaces == '':
        print(
            red('You must give me a list of interfaces through the gap for the deploy.'
                ))
        exit()

    interfaces = interfaces.split(' ')

    # check share
    if 'share' not in interfaces:
        print(red('You must give the interface - \'share\', too'))
        exit()

    # set path
    templates_path = common.get_templates(path='templates/web-interfaces')
    install_path = common.get_install(path='/var/www')

    if not files.exists(install_path):
        run('mkdir -p ' + install_path)

    for interface in interfaces:
        if not files.exists(install_path + '/' + interface):
            run('mkdir ' + install_path + '/' + interface)
        put(templates_path + '/' + interface + '/data/*',
            install_path + '/' + interface)
예제 #5
0
def put_tomcat_apps(apps="", ext='war'):
    if apps == '':
        print(
            red('You must give me a list of the tomcat apps through the gap for the deploy.'
                ))
        exit()

    apps = apps.split(' ')

    # set path
    templates_path = common.get_templates(
        path="templates/web-interfaces/tomcat")
    install_path = common.get_install(path="/tmp/tomcat")

    if not files.exists(install_path):
        run('mkdir ' + install_path)

    for app in apps:
        if os.path.exists(templates_path + '/' + app + '.' + ext):
            put(templates_path + '/' + app + '.' + ext, install_path)
        else:
            print(
                red('The application ' + app + ' doesn\'t upload to the ' +
                    env.host_string + ' because it not exists in ' +
                    templates_path))
예제 #6
0
def put_profile_app(profiles='',ext='tar.gz'):
	if not profiles and profiles == '':
		profiles=prompt('What a name of the profiles of the tomcat applications do you want?', default='')

	profiles=profiles.split(' ')

	# set path
	templates_path=common.get_templates(path="templates/web-interfaces/profiles")
	install_path=common.get_install(path="/tmp/tomcat/profiles")

	if not files.exists(install_path):
		run('mkdir '+install_path)

	for profile in profiles:
			if os.path.exists(templates_path+'/'+profile+'.'+ext):
				put(templates_path+'/'+profile+'.'+ext, install_path)
			else:
				print(red('The profile '+profile+'.'+ext+' doesn\'t upload to the '+env.host_string+' because it not exists in '+templates_path))
예제 #7
0
def put_tomcat_apps(apps="",ext='war'):
	if apps == '':
		print (red('You must give me a list of the tomcat apps through the gap for the deploy.'))
		exit()

	apps=apps.split(' ')

	# set path
	templates_path=common.get_templates(path="templates/web-interfaces/tomcat")
	install_path=common.get_install(path="/tmp/tomcat")

	if not files.exists(install_path):
		run('mkdir '+install_path)

	for app in apps:
			if os.path.exists(templates_path+'/'+app+'.'+ext):
				put(templates_path+'/'+app+'.'+ext, install_path)
			else:
				print(red('The application '+app+' doesn\'t upload to the '+env.host_string+' because it not exists in '+templates_path))
예제 #8
0
def get_profile_app(apps='',version='release',profile='',ext='tar.gz'):
	if apps == '':
		print (red('You must give me a list of the tomcat apps through the gap for the deploy.'))
		exit()

	if (version != 'release' and version != 'snapshot'):
		print(red('The available values of the version is release or snapshot.'))
		version=prompt('What a version of the profile do you want - release|snapshot?', default='release')

	if version == 'snapshot':
		version='LATEST'

	if not profile and profile == '':
		profile=prompt('What a name of the profile of the tomcat applications do you want?', default='')

	apps=apps.split(' ')

	# set path
	templates_path=common.get_templates(path="templates/web-interfaces/profiles")

	version=version.upper()

	# create directory
	if not os.path.exists(templates_path):
		local('mkdir '+templates_path)

	for app in apps:
		if app == 'vcc':
			local('curl -s -o '+templates_path+'/'+profile+'.'+ext+' -L -G '+set_nexus_url(g='se.teligent.mobicom.'+app,a=app+'-web',v=version,c=profile,p=ext))
		if app == 'conference':
			local('curl -s -o '+templates_path+'/'+profile+'.'+ext+' -L -G '+set_nexus_url(g='se.teligent.mobicom.'+app,a=app+'-web',v=version,c=profile,p=ext))
		if app == 'url':
			local('curl -s -o '+templates_path+'/'+profile+'.'+ext+' -L -G '+set_nexus_url(g='se.teligent.mobicom.'+app,a=app+'-web',v=version,c=profile,p=ext))
		if app == 'community':
			local('curl -s -o '+templates_path+'/'+profile+'.'+ext+' -L -G '+set_nexus_url(g='se.teligent.'+app+'',a=app+'-web',v=version,c=profile,p=ext))
		if app == 'mas':
			local('curl -s -o '+templates_path+'/'+profile+'.'+ext+' -L -G '+set_nexus_url(g='se.teligent.mobicom.'+app+'',a=app+'-web',v=version,c=profile,p=ext))
		if app == 'cc':
			local('curl -s -o '+templates_path+'/'+profile+'.'+ext+' -L -G '+set_nexus_url(g='se.teligent.'+app+'',a=app+'-web',v=version,c=profile,p=ext))
		if app == 'massonic':
			local('curl -s -o '+templates_path+'/'+profile+'.'+ext+' -L -G '+set_nexus_url(g='se.teligent.mas',a='mas-web',v=version,c=profile,p=ext))
예제 #9
0
def install_tomcat_apps(apps='', ext='war'):
    if apps == '':
        print(
            red('You must give me a list of the tomcat apps through the gap for the deploy.'
                ))
        exit()

    apps = apps.split(' ')

    # set path
    templates_path = common.get_templates(path='/tmp/tomcat')
    install_path = common.get_install(path='/var/lib/tomcat7')

    if not files.exists(templates_path):
        print(
            red('The path ' + templates_path +
                ' to the tomcat applications on the ' + env.host_string +
                ' isn\'t exists'))
        exit()

    for app in apps:
        if files.exists(templates_path + '/' + app + '.' + ext):
            if not files.exists(install_path + '/' + app + '/webapps/' + app):
                run('mkdir ' + install_path + '/' + app + '/webapps/' + app)
                run('cp ' + templates_path + '/' + app + '.' + ext + ' ' +
                    install_path + '/' + app + '/webapps/' + app)
                with cd(install_path + '/' + app + '/webapps/' + app):
                    if files.exists('/usr/bin/unzip'):
                        run('unzip ' + app + '.' + ext)
                        run('rm -f ' + app + '.' + ext)
                    else:
                        print(
                            red('You must install the unzip on the ' +
                                env.host_string))
                        exit()
        else:
            print(
                red('The path to the tomcat\'s application \'' + app +
                    '\' isn\'t exists'))
예제 #10
0
def put_client_interfaces(interfaces=''):
	if interfaces == '':
		print (red('You must give me a list of interfaces through the gap for the deploy.'))
		exit()

	interfaces=interfaces.split(' ')

	# check share
	if 'share' not in interfaces:
		print (red('You must give the interface - \'share\', too'))
		exit()

	# set path
	templates_path=common.get_templates(path='templates/web-interfaces')
	install_path=common.get_install(path='/var/www')

	if not files.exists(install_path):
		run('mkdir -p '+install_path)

	for interface in interfaces:
		if not files.exists(install_path+'/'+interface):
			run('mkdir '+install_path+'/'+interface)
		put(templates_path+'/'+interface+'/data/*', install_path+'/'+interface)
예제 #11
0
def get_client_interfaces(interfaces=''):
	if interfaces == '':
		print (red('You must give me a list of interfaces through the gap for the deploy.'))
		exit()

	interfaces=interfaces.split(' ')

	# check share
	if 'share' not in interfaces:
		print (red('You must give the interface - share, too'))
		exit()

	# set path
	templates_path=common.get_templates(path='templates/web-interfaces')

	for interface in interfaces:
		if os.path.exists(templates_path+'/'+interface):
			local('test -d '+templates_path+'/'+interface+' && cd '+templates_path+' && rm -rf ./'+interface)

		if interface == 'vcc':
			local('git clone -b teligent [email protected]:/webstroy/'+interface+'-teligent.git '+templates_path+'/'+interface+'')
		else:
			local('git clone [email protected]:/webstroy/'+interface+'-teligent.git '+templates_path+'/'+interface+'')
예제 #12
0
def install_profile_app(apps='', ext='tar.gz', profile=''):
    if apps == '':
        print(
            red('You must give me a list of the tomcat apps through the gap for the deploy.'
                ))
        exit()

    if not profile and profile == '':
        profile = prompt(
            'What a name of the profile of the tomcat applications do you want?',
            default='')

    apps = apps.split(' ')

    # set path
    templates_path = common.get_templates(path='/tmp/tomcat/profiles')
    install_path = common.get_install(path='/var/lib/tomcat7')

    if not files.exists(templates_path):
        print(
            red('The path ' + templates_path +
                ' to the tomcat applications isn\'t exists'))
        exit()

    for app in apps:
        if files.exists(templates_path + '/' + profile + '.' + ext):
            run('cp ' + templates_path + '/' + profile + '.' + ext + ' ' +
                install_path + '/' + app + '/webapps/' + app)
            with cd(install_path + '/' + app + '/webapps/' + app + ''):
                with prefix('tar -xzf ' + profile + '.' + ext):
                    run('rm -f ' + profile + '.' + ext)
        else:
            print(
                red('The path to the profile \'' + profile +
                    '\' of the tomcat\'s application \'' + app +
                    '\' isn\'t exists'))
예제 #13
0
def put_profile_app(profiles='', ext='tar.gz'):
    if not profiles and profiles == '':
        profiles = prompt(
            'What a name of the profiles of the tomcat applications do you want?',
            default='')

    profiles = profiles.split(' ')

    # set path
    templates_path = common.get_templates(
        path="templates/web-interfaces/profiles")
    install_path = common.get_install(path="/tmp/tomcat/profiles")

    if not files.exists(install_path):
        run('mkdir ' + install_path)

    for profile in profiles:
        if os.path.exists(templates_path + '/' + profile + '.' + ext):
            put(templates_path + '/' + profile + '.' + ext, install_path)
        else:
            print(
                red('The profile ' + profile + '.' + ext +
                    ' doesn\'t upload to the ' + env.host_string +
                    ' because it not exists in ' + templates_path))
예제 #14
0
def get_profile_app(apps='', version='release', profile='', ext='tar.gz'):
    if apps == '':
        print(
            red('You must give me a list of the tomcat apps through the gap for the deploy.'
                ))
        exit()

    if (version != 'release' and version != 'snapshot'):
        print(
            red('The available values of the version is release or snapshot.'))
        version = prompt(
            'What a version of the profile do you want - release|snapshot?',
            default='release')

    if version == 'snapshot':
        version = 'LATEST'

    if not profile and profile == '':
        profile = prompt(
            'What a name of the profile of the tomcat applications do you want?',
            default='')

    apps = apps.split(' ')

    # set path
    templates_path = common.get_templates(
        path="templates/web-interfaces/profiles")

    version = version.upper()

    # create directory
    if not os.path.exists(templates_path):
        local('mkdir ' + templates_path)

    for app in apps:
        if app == 'vcc':
            local('curl -s -o ' + templates_path + '/' + profile + '.' + ext +
                  ' -L -G ' + set_nexus_url(g='se.teligent.mobicom.' + app,
                                            a=app + '-web',
                                            v=version,
                                            c=profile,
                                            p=ext))
        if app == 'conference':
            local('curl -s -o ' + templates_path + '/' + profile + '.' + ext +
                  ' -L -G ' + set_nexus_url(g='se.teligent.mobicom.' + app,
                                            a=app + '-web',
                                            v=version,
                                            c=profile,
                                            p=ext))
        if app == 'url':
            local('curl -s -o ' + templates_path + '/' + profile + '.' + ext +
                  ' -L -G ' + set_nexus_url(g='se.teligent.mobicom.' + app,
                                            a=app + '-web',
                                            v=version,
                                            c=profile,
                                            p=ext))
        if app == 'community':
            local('curl -s -o ' + templates_path + '/' + profile + '.' + ext +
                  ' -L -G ' + set_nexus_url(g='se.teligent.' + app + '',
                                            a=app + '-web',
                                            v=version,
                                            c=profile,
                                            p=ext))
        if app == 'mas':
            local('curl -s -o ' + templates_path + '/' + profile + '.' + ext +
                  ' -L -G ' +
                  set_nexus_url(g='se.teligent.mobicom.' + app + '',
                                a=app + '-web',
                                v=version,
                                c=profile,
                                p=ext))
        if app == 'cc':
            local('curl -s -o ' + templates_path + '/' + profile + '.' + ext +
                  ' -L -G ' + set_nexus_url(g='se.teligent.' + app + '',
                                            a=app + '-web',
                                            v=version,
                                            c=profile,
                                            p=ext))
        if app == 'massonic':
            local('curl -s -o ' + templates_path + '/' + profile + '.' + ext +
                  ' -L -G ' + set_nexus_url(g='se.teligent.mas',
                                            a='mas-web',
                                            v=version,
                                            c=profile,
                                            p=ext))