def copy_distrib_file(): command = helper.new_docker_command() command.append('-v') command.append(helper.this_path + helper.replace_sep('images/gate') + ':/main_dir') command.append('alpine') command.append('sh -c') command.append('"cp /out_files/appgate*.deb /main_dir/distr/appgate.deb"') return command
def prepare_new_ib(ib_name, int_name, conf_file_name, job_block): job_dn_str = 'Y' if job_block else 'N' action = 'create_ib' result = call(' '.join( helper.create_ib_command(host_name, ib_name, conf_file_name, job_dn_str, action)), remote=False, action='Creating ' + ib_name, measure_duration=True) check_call_work(result, action, ib_name) action = 'install_control_ext' result = call(' '.join( helper.install_control_ext_command(host_name, ib_name, action)), remote=False, action='Installing control extension', measure_duration=True) check_call_work(result, action, ib_name) ext_name = helper.replace_sep(local_work_dir + 'mnt/' + ib_name + '.cfe') if os.path.isfile(ext_name): action = 'install_ext' result = call(' '.join( helper.install_ext_command(host_name, ib_name, action)), remote=False, action='Installing extension', measure_duration=True) check_call_work(result, action, ib_name) if ib_name == 'sm': action = 'install_sm_ext' post_data = '/mnt/other-files/params.json' result = call(' '.join( helper.install_sm_ext_command(host_name, ib_name, action)), remote=False, action='Installing gate control extension', measure_duration=True) check_call_work(result, action, ib_name) else: post_data = '' action = 'disable_safe_mode' result = call(' '.join(helper.disable_safe_mode(host_name, ib_name, action)), remote=False, action='Disabling safe mode for extensions', measure_duration=True) check_call_work(result, action, ib_name) str_post = '-d @{}'.format(post_data) if post_data != '' else '' call( 'docker exec web.{} curl {} -X POST http://localhost/int/{}/hs/api.1cfresh/init' .format(host_name, str_post, int_name), remote=False, action='Initialization', measure_duration=True)
def unzip_platform_distr(): command = helper.new_docker_command() command.append('-v') command.append(helper.this_path + helper.replace_sep('images/core') + ':/main_dir') command.append('alpine') command.append('sh') command.append('/main_dir/get_platform.sh') return command
def unzip_site_dir(): command = helper.new_docker_command() command.append('-v') command.append(helper.this_path + helper.replace_sep('images/site') + ':/main_dir') command.append('kubeless/unzip') command.append('unzip') command.append('/out_files/site_*.zip') command.append('-d') command.append('/main_dir/distr/site') return command
def unzip_platform_distr(is_new_path_to_platform): command = helper.new_docker_command() command.append('-v') command.append(helper.this_path + helper.replace_sep('images/core') + ':/main_dir') command.append('alpine') command.append('sh') if is_new_path_to_platform: command.append('/main_dir/get_platform_from_20_ver.sh') else: command.append('/main_dir/get_platform_to_19_ver.sh') return command
import codecs from datetime import datetime host_name = '.1cfresh.dev' sup_password = '******' new_server = False global_debug = False info_base_list = [] configurations = {} docker_run_str = 'docker run --rm -v {}:/out_files alpine'.format(helper.this_path) docker_compose_str = 'docker-compose -f workdir/docker-compose.yml ' work_dir = '/out_files/workdir/' work_dir_other = work_dir + 'mnt/other-files/' local_work_dir = helper.replace_sep(helper.this_path + 'workdir/') class colors: GREEN = '\033[92m' WHITE = '\033[97m' RED = '\033[91m' class ib_prop: a_name = 'ИмяВнешнейПубликации' a_desc = 'ИмяФайлаШаблонаВнешненийПубликации' int_name = 'ИмяВнутреннейПубликации' int_desc = 'ИмяФайлаШаблонаВнутреннейПубликации' conf_file = 'ИмяФайлаКонфигурации' name = 'ИмяВКластере' job = 'БлокироватьРаботуРегЗаданийПриСоздании'
def add_forum_dir(command): command.append('-v') command.append(helper.this_path + helper.replace_sep('images/forum') + ':/main_dir')