diff --git a/README.md b/README.md index b0f774a..690442f 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,10 @@ sudo usermod -aG docker ${USER} - [Менеджер сервиса. Версия 1.0.94.20](https://releases.1c.ru/version_file?nick=FreshPublic&ver=1.0.28.1&path=SM\1_0_94_20\SM_1_0_94_20_setup1c.exe "Менеджер сервиса. Версия 1.0.94.20") - [Агент сервиса. Версия 1.0.29.4](https://releases.1c.ru/version_file?nick=FreshPublic&ver=1.0.28.1&path=SA\1_0_29_4\SA_1_0_29_4_setup1c.exe "Агент сервиса. Версия 1.0.29.4") - [Менеджер доступности. Версия 1.0.3.4](https://releases.1c.ru/version_file?nick=FreshPublic&ver=1.0.28.1&path=AM\1_0_3_4\AM_1_0_3_4_setup1c.exe "Менеджер доступности. Версия 1.0.3.4") -- [1С:Библиотека технологии сервиса, редакция 1.2. Версия 1.2.2.26](https://releases.1c.ru/version_files?nick=SMTL12&ver=1.2.2.26 "1С:Библиотека технологии сервиса, редакция 1.2. Версия 1.2.2.26") +- [1С:Библиотека технологии сервиса, редакция 1.2. Версия 1.2.2.26](https://releases.1c.ru/version_files?nick=SMTL12&ver=1.2.2.26 "1С:Библиотека технологии сервиса, редакция 1.2. Версия 1.2.2.26") + +##### Для версий платформ начиная с 8.3.20 +Необходимо так же [скачать](https://releases.1c.ru/project/EnterpriseLicenseTools) и разместить архив с утилитой лицензирования в каталог `/docker_fresh/distr/` ## 1. Подготовка к развертыванию @@ -93,9 +96,10 @@ cd docker_fresh Сборка образов запускается командой ```bash -sudo python3 install.py +sudo python3 install.py -v 8.3.15.1869 ``` -**install.py** имеет возможность запуска с флагом **-debug**. При запуске с данным флагом весь процесс сборки будет подробно отображаться на экране. +**install.py** имеет возможность запуска с флагом **-debug**. При запуске с данным флагом весь процесс сборки будет подробно отображаться на экране. +**-v** необходимо указать номер версии платформы дистрибутивы который вы скачали ## 2. Настройка лицензирования diff --git a/images/core/Dockerfile_20 b/images/core/Dockerfile_20 new file mode 100644 index 0000000..d13f30a --- /dev/null +++ b/images/core/Dockerfile_20 @@ -0,0 +1,37 @@ +FROM fresh/centos + +ARG DISTR_VERSION + +ADD ./distr/setup-full-$DISTR_VERSION-x86_64.run /tmp/core/ +ADD ./distr/license /tmp/core/license +ADD ./distr/*.rpm /tmp/core/ + +RUN yum -y localinstall /tmp/core/*.rpm ;\ + sed -i '/User apache/ s//User usr1cv8/g' /etc/httpd/conf/httpd.conf ;\ + sed -i '/Group apache/ s//Group grp1cv8/g' /etc/httpd/conf/httpd.conf ;\ + sed -i '/#ServerName www.example.com:80/ s//ServerName localhost/g' /etc/httpd/conf/httpd.conf ;\ + yum -y install x11vnc metacity net-tools gdb perl tar git jq ca-certificates ;\ + yum -y install https://centos7.iuscommunity.org/ius-release.rpm ;\ + yum -y --setopt=tsflags=nodocs install python36u python36u-devel python36u-pip ;\ + yum -y install java-1.8.0-openjdk iproute ;\ + /tmp/core/setup-full-$DISTR_VERSION-x86_64.run --mode unattended --enable-components client_full,server,ws,ru,uk ;\ + chmod +x /tmp/core/license/1ce-installer-cli; /tmp/core/license/1ce-installer-cli install --ignore-signature-warnings ;\ + update-ca-trust ;\ + rm -rf /tmp/core ;\ + oscript /usr/share/oscript/lib/opm/src/cmd/opm.os install deployka ;\ + chmod +x /usr/bin/deployka + +ENV COREDATA /var/lib/1c/data +ENV CORELOGS /var/log/1c +ENV AGENTBASEDIR /var/lib/1c/agent_data +ENV INFOBASECONNECTIONSTRING "" + +VOLUME ["${COREDATA}", "${CORELOGS}", "${AGENTBASEDIR}"] + +ADD ./entrypoint.sh / +RUN chmod +x /entrypoint.sh + +ADD ./dumper.py /usr/bin/dumper +RUN chmod +x /usr/bin/dumper + +ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file diff --git a/images/core/get_platform.sh b/images/core/get_platform.sh deleted file mode 100644 index 9b3c5fd..0000000 --- a/images/core/get_platform.sh +++ /dev/null @@ -1,5 +0,0 @@ -cd /out_files - - tar -xvf client*.rpm64.tar.gz --exclude "*thin*.rpm" --exclude "*nls*.rpm" --exclude "license-tools" -C /main_dir/distr - tar -xvf rpm64_*.tar.gz --exclude "*crs*.rpm" --exclude "*nls*.rpm" -C /main_dir/distr - diff --git a/images/core/get_platform_from_20_ver.sh b/images/core/get_platform_from_20_ver.sh new file mode 100644 index 0000000..22d6144 --- /dev/null +++ b/images/core/get_platform_from_20_ver.sh @@ -0,0 +1,6 @@ +cd /out_files + +tar -xvf server64*.tar.gz -C /main_dir/distr + +mkdir /main_dir/distr/license +tar -xvf *license_tools*.tar.gz -C /main_dir/distr/license \ No newline at end of file diff --git a/images/core/get_platform_to_19_ver.sh b/images/core/get_platform_to_19_ver.sh new file mode 100644 index 0000000..a8bd4d6 --- /dev/null +++ b/images/core/get_platform_to_19_ver.sh @@ -0,0 +1,4 @@ +cd /out_files + +tar -xvf client*.rpm64.tar.gz --exclude "*thin*.rpm" --exclude "*nls*.rpm" --exclude "license-tools" -C /main_dir/distr +tar -xvf rpm64_*.tar.gz --exclude "*crs*.rpm" --exclude "*nls*.rpm" -C /main_dir/distr diff --git a/install.py b/install.py index ffec850..85b47ea 100644 --- a/install.py +++ b/install.py @@ -27,15 +27,23 @@ def image_exist(image_name): return full_image_name in str(result.stdout) +if '-v' not in sys.argv: + print('parameter -v not specified') + exit(1) +else: + platform_ver = sys.argv[sys.argv.index('-v') + 1] +is_new_path_to_platform = int(platform_ver.split('.')[2]) >= 20 + images = [] images.append(centos.New()) images.append(db.New()) images.append(site.New()) images.append(forum.New()) -images.append(core.New()) +images.append(core.New(is_new_path_to_platform)) images.append(gate.New()) debug = '-debug' in sys.argv + start_time = datetime.now() print('{}Build is starting{}'.format(colors.GREEN, colors.WHITE)) @@ -54,8 +62,20 @@ for image in images: if debug: print(command) subprocess.call(' '.join(command), shell=True, stdout=stdout, stderr=stderr) - result = subprocess.run(['docker', 'build', '-t', 'fresh/' + image.name, 'images/' + image.name], - stdout=stdout, stderr=stderr) + command_to_run = [ + 'docker', + 'build', + '-t', + 'fresh/' + image.name] + + if image.name == 'core' and is_new_path_to_platform: + command_to_run.append('-f') + command_to_run.append('images/' + image.name + '/Dockerfile_20') + command_to_run.append('--build-arg') + command_to_run.append('DISTR_VERSION=' + platform_ver) + command_to_run.append('images/' + image.name) + + result = subprocess.run(command_to_run, stdout=stdout, stderr=stderr) if result.returncode != 0 or not image_exist(image.name): print('Building', image.name , '...', '{}error'.format(colors.RED), colors.WHITE) diff --git a/modules/core.py b/modules/core.py index 9a9fa4d..4e3a86c 100644 --- a/modules/core.py +++ b/modules/core.py @@ -9,20 +9,23 @@ def download_onescript(): command.append('https://oscript.io/downloads/1_4_0/x64/onescript-engine-1.4.0-1.fc26.noarch.rpm') return command -def unzip_platform_distr(): +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') - command.append('/main_dir/get_platform.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 -def add_all_before_commands(): +def add_all_before_commands(is_new_path_to_platform): commands = [] commands.append(download_onescript()) - commands.append(unzip_platform_distr()) + commands.append(unzip_platform_distr(is_new_path_to_platform)) return commands def delete_core_distr_files(): @@ -49,7 +52,7 @@ class New(): commands_before = [] commands_after = [] - def __init__(self): + def __init__(self, is_new_path_to_platform): self.name = 'core' - self.commands_before = add_all_before_commands() + self.commands_before = add_all_before_commands(is_new_path_to_platform) self.commands_after = add_all_after_commands() \ No newline at end of file