1
0
mirror of https://github.com/1C-Company/docker_fresh.git synced 2024-12-12 10:45:25 +02:00

Исправил ошибку формата потока

This commit is contained in:
WizaXxX 2021-03-13 22:25:31 +03:00
parent 42342c6b12
commit 7ca581e187
4 changed files with 60 additions and 22 deletions

View File

@ -72,7 +72,7 @@ services:
command: srv+cli
volumes:
- 1c_pg_socket:/tmp/postgresql/socket
- ./artifacts/srv/data:/var/lib/1c/data
- 1c_server_data:/var/lib/1c/data
- ./artifacts/srv/log:/var/log/1c
- ./mnt:/mnt
- /tmp/.aksusb:/tmp/.aksusb
@ -154,4 +154,5 @@ services:
volumes:
1c_pg_data:
1c_pg_socket:
1c_pg_socket:
1c_server_data:

View File

@ -26,6 +26,16 @@ def new_docker_command(extra_path=None):
command.append(current_distr_path + ':/out_files')
return command
def add_command_copy_file_from_mnt_to_tmp(commands, container_name, full_path, file_name):
commands.append('docker')
commands.append('exec')
commands.append(container_name)
commands.append('sh')
commands.append('-c')
commands.append('"cp {} /tmp/{}"'.format(full_path, file_name))
commands.append('&&')
def web_publish_command(host_name, conf_name, internal, descriptor, base_name=''):
if internal:
@ -59,32 +69,42 @@ def get_out_file_name_command(action, ib_name):
return '/Out "/mnt/{}_{}.out"'.format(action, ib_name)
def create_ib_command(host_name, ib_name, file_name, job_block, action):
full_path = '/mnt/{}'.format(file_name)
container_name = 'srv.{}'.format(host_name)
command = []
add_command_copy_file_from_mnt_to_tmp(command, container_name, full_path, file_name)
command.append('docker')
command.append('exec')
command.append('-t')
command.append('srv.' + host_name)
command.append(container_name)
command.append('{}1cv8'.format(path_to_1c))
command.append('CREATEINFOBASE')
command.append('"Srvr=srv;Ref={0};DBMS=PostgreSQL;DBSrvr=/tmp/postgresql/socket;DB={0};DBUID=postgres;LicDstr=Y;Locale=ru_RU;CrSQLDB=Y;SchJobDn={1};"'.format(
ib_name, job_block))
command.append('/UseTemplate')
command.append('/mnt/{}'.format(file_name))
command.append('/tmp/{}'.format(file_name))
command.append(get_out_file_name_command(action, ib_name))
return command
def install_control_ext_command(host_name, ib_name, action):
full_path = '/mnt/other-files/cfe/api_1cfresh.cfe'
container_name = 'srv.{}'.format(host_name)
command = []
add_command_copy_file_from_mnt_to_tmp(command, container_name, full_path, 'api_1cfresh.cfe')
command.append('docker')
command.append('exec')
command.append('-t')
command.append('srv.' + host_name)
command.append(container_name)
command.append('{}1cv8'.format(path_to_1c))
command.append('DESIGNER')
command.append('/S')
command.append('"srv\\{}"'.format(ib_name))
command.append('/LoadCfg')
command.append('"/mnt/other-files/cfe/api_1cfresh.cfe"')
command.append('"/tmp/api_1cfresh.cfe"')
command.append('-Extension')
command.append('"api_1cfresh"')
command.append('/UpdateDBCfg')
@ -92,17 +112,22 @@ def install_control_ext_command(host_name, ib_name, action):
return command
def install_sm_ext_command(host_name, ib_name, action):
full_path = '/mnt/other-files/cfe/УправлениеМС.cfe'
container_name = 'srv.{}'.format(host_name)
command = []
add_command_copy_file_from_mnt_to_tmp(command, container_name, full_path, 'УправлениеМС.cfe')
command.append('docker')
command.append('exec')
command.append('-t')
command.append('srv.' + host_name)
command.append(container_name)
command.append('{}1cv8'.format(path_to_1c))
command.append('DESIGNER')
command.append('/S')
command.append('"srv\\{}"'.format(ib_name))
command.append('/LoadCfg')
command.append('"/mnt/other-files/cfe/УправлениеМС.cfe"')
command.append('"/tmp/УправлениеМС.cfe"')
command.append('-Extension')
command.append('"УправлениеМС"')
command.append('/UpdateDBCfg')
@ -110,17 +135,23 @@ def install_sm_ext_command(host_name, ib_name, action):
return command
def install_ext_command(host_name, ib_name, action):
full_path = '/mnt/{}.cfe'.format(ib_name)
file_name = '{}.cfe'.format(ib_name)
container_name = 'srv.{}'.format(host_name)
command = []
add_command_copy_file_from_mnt_to_tmp(command, container_name, full_path, file_name)
command.append('docker')
command.append('exec')
command.append('-t')
command.append('srv.' + host_name)
command.append(container_name)
command.append('{}1cv8'.format(path_to_1c))
command.append('DESIGNER')
command.append('/S')
command.append('"srv\\{}"'.format(ib_name))
command.append('/LoadCfg')
command.append('"/mnt/{}.cfe"'.format(ib_name))
command.append('"/tmp/{}"'.format(file_name))
command.append('-Extension')
command.append('"fresh"')
command.append('/UpdateDBCfg')
@ -128,17 +159,22 @@ def install_ext_command(host_name, ib_name, action):
return command
def disable_safe_mode(host_name, ib_name, action):
full_path = '/mnt/other-files/cfe/disable.epf'
container_name = 'srv.{}'.format(host_name)
command = []
add_command_copy_file_from_mnt_to_tmp(command, container_name, full_path, 'disable.epf')
command.append('docker')
command.append('exec')
command.append('-t')
command.append('srv.' + host_name)
command.append(container_name)
command.append('{}1cv8'.format(path_to_1c))
command.append('ENTERPRICE')
command.append('/S')
command.append('"srv\\{}"'.format(ib_name))
command.append('/Execute')
command.append('"/mnt/other-files/cfe/disable.epf"')
command.append('"/tmp/disable.epf"')
command.append(get_out_file_name_command(action, ib_name))
return command

View File

@ -29,7 +29,7 @@
"ИмяФайлаШаблонаВнутреннейПубликации": "zoneless",
"СоздаватьВМенеджере": true,
"ИмяФайлаКонфигурации":"smtl.cf",
"БлокироватьРаботуРегЗаданийПриСоздании": false
"БлокироватьРаботуРегЗаданийПриСоздании": true
},
{
"Сервер": "web/int/sa",
@ -44,7 +44,7 @@
"ИмяФайлаШаблонаВнутреннейПубликации": "zoneless",
"СоздаватьВМенеджере": true,
"ИмяФайлаКонфигурации":"sa.cf",
"БлокироватьРаботуРегЗаданийПриСоздании": false
"БлокироватьРаботуРегЗаданийПриСоздании": true
},
{
"Сервер": "",
@ -59,7 +59,7 @@
"ИмяФайлаШаблонаВнутреннейПубликации": "zoneless",
"СоздаватьВМенеджере": false,
"ИмяФайлаКонфигурации":"am.cf",
"БлокироватьРаботуРегЗаданийПриСоздании": false
"БлокироватьРаботуРегЗаданийПриСоздании": true
}
]
}

View File

@ -212,6 +212,7 @@ def delete_volumes():
call('docker volume rm workdir_1c_pg_data', remote=False)
call('docker volume rm workdir_1c_pg_socket', remote=False)
call('docker volume rm workdir_1c_server_data', remote=False)
@print_description
def prepare_bases():
@ -229,6 +230,8 @@ def prepare_bases():
conf_file_name=ib_data[ib_prop.conf_file],
job_block=ib_data[ib_prop.job]
)
if ib_data[ib_prop.job]:
enable_job(ib_data[ib_prop.name], ib_data[ib_prop.adm])
# prepare sm base
prepare_new_ib(
@ -236,7 +239,9 @@ def prepare_bases():
int_name=sm_ib[ib_prop.int_name],
conf_file_name=sm_ib[ib_prop.conf_file],
job_block=sm_ib[ib_prop.job]
)
)
if ib_prop.job:
enable_job(ib_data[ib_prop.name], ib_data[ib_prop.adm])
@print_description
def renew_nginx_files():
@ -413,12 +418,9 @@ def wait_site():
call('docker exec -t site.{} /wait_site.sh'.format(host_name), remote=False)
def enable_job(base_name, user):
@print_description
def enable_job_in_sm():
"""Enable scheduled jobs sm"""
call('docker exec -t ras.{} deployka scheduledjobs unlock -db sm -db-user "Администратор"'.format(host_name),
call('docker exec -t ras.{} deployka scheduledjobs unlock -db {} -db-user "{}"'.format(host_name, base_name, user),
remote=False)
@print_description
@ -465,7 +467,6 @@ if new_server:
create_bucket()
publish_sevises()
prepare_bases()
enable_job_in_sm()
create_db_site()
create_db_forum()