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

53 lines
1.4 KiB
Python
Raw Normal View History

2020-04-05 15:23:33 +02:00
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')
2020-04-05 20:21:05 +02:00
command.append('sh')
command.append('-c')
command.append('"rm -rf /out_files/forum"')
2020-04-05 15:23:33 +02:00
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')
2020-07-21 16:49:06 +02:00
command.append('"mv /out_files/forum/*.war /out_files/forum/ROOT.war"')
2020-04-05 15:23:33 +02:00
return command
2020-04-05 17:07:02 +02:00
def add_all_before_commands():
2020-04-05 15:23:33 +02:00
commands = []
commands.append(unzip_forum_dir())
commands.append(rename_forum_file())
return commands
2020-04-05 17:07:02 +02:00
def add_all_after_commands():
commands = []
commands.append(delete_forum_dir())
return commands
2020-04-05 15:23:33 +02:00
class New():
name = ''
2020-04-05 17:07:02 +02:00
commands_before = []
commands_after = []
2020-04-05 15:23:33 +02:00
def __init__(self):
self.name = 'forum'
2020-04-05 17:07:02 +02:00
self.commands_before = add_all_before_commands()
self.commands_after = add_all_after_commands()