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)
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'))
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'))
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))
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))
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))
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'))
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)
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'))
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))