1
0
mirror of https://github.com/1C-Company/docker_fresh.git synced 2025-07-15 01:24:20 +02:00

add forum image

This commit is contained in:
WizaXxX
2020-04-05 16:23:33 +03:00
parent 6a8d1115e9
commit 10664a9f6d
6 changed files with 268 additions and 0 deletions

55
modules/forum.py Normal file
View File

@ -0,0 +1,55 @@
import subprocess
import pathlib
import os
import modules.helper as helper
def add_forum_dir(command):
command.append('-v')
command.append(helper.this_path + helper.replace_sep('images/forum') + ':/main_dir')
def delete_forum_dir():
command = helper.new_docker_command('images/forum/distr')
command.append('alpine')
command.append('rm')
command.append('-rf')
command.append('/out_files/forum')
return command
def unzip_forum_dir():
command = helper.new_docker_command()
add_forum_dir(command)
command.append('kubeless/unzip')
command.append('unzip')
command.append('/out_files/forum_*.zip')
command.append('-d')
command.append('/main_dir/distr/forum')
return command
def rename_forum_file():
command = helper.new_docker_command('images/forum/distr')
command.append('alpine')
command.append('sh')
command.append('-c')
command.append('"mv /out_files/forum/forum*.war /out_files/forum/ROOT.war"')
return command
def add_all_commands():
commands = []
commands.append(delete_forum_dir())
commands.append(unzip_forum_dir())
commands.append(rename_forum_file())
return commands
class New():
name = ''
commands = []
def __init__(self):
self.name = 'forum'
self.commands = add_all_commands()