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

Адаптировали для развертывания на платформах 8.3.20+ (#27)

Адаптировали для развертывания на платформах 8.3.20+

* renew serts (#27)

* renew sert

* Добавил описание развертывания с учетом расширения БТС #21

* renew sert

* renew sert

* renew sert

* renew sert

* renew sert

* renew sert

* renew sert

* renew sert

* renew sert

* renew sert

* renew sert

* renew sert

* renew sert

* init (#28)

Co-authored-by: WizaXxX <wizax01@gmail.com>

Co-authored-by: WizaXxX <wizax01@gmail.com>
This commit is contained in:
Ilya 2022-06-08 10:29:36 +03:00 committed by GitHub
parent f0f92f79b5
commit 9e409bd5fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 86 additions and 17 deletions

View File

@ -53,6 +53,9 @@ sudo usermod -aG docker ${USER}
- [Менеджер доступности. Версия 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")
##### Для версий платформ начиная с 8.3.20
Необходимо так же [скачать](https://releases.1c.ru/project/EnterpriseLicenseTools) и разместить архив с утилитой лицензирования в каталог `/docker_fresh/distr/`
## 1. Подготовка к развертыванию
Данный стенд для простоты развертывания использует домен 1cfresh.dev и валидные, выданные let's encrypt сертификаты.
@ -93,9 +96,10 @@ cd docker_fresh
Сборка образов запускается командой
```bash
sudo python3 install.py
sudo python3 install.py -v 8.3.15.1869
```
**install.py** имеет возможность запуска с флагом **-debug**. При запуске с данным флагом весь процесс сборки будет подробно отображаться на экране.
**-v** необходимо указать номер версии платформы дистрибутивы который вы скачали
## 2. Настройка лицензирования

37
images/core/Dockerfile_20 Normal file
View File

@ -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"]

View File

@ -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

View File

@ -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

View File

@ -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

View File

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

View File

@ -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()