add restart command
All checks were successful
Publish Docker Image / docker (push) Successful in 2m53s

This commit is contained in:
Lee 2024-04-17 02:24:45 +01:00
parent 4ee7337e9d
commit cacdf1f5b9
5 changed files with 16 additions and 4 deletions

@ -1,6 +1,7 @@
from command.impl.addCommand import AddCommand from command.impl.addCommand import AddCommand
from command.impl.listCommand import ListCommand from command.impl.listCommand import ListCommand
from command.impl.removeCommand import RemoveCommand from command.impl.removeCommand import RemoveCommand
from command.impl.restartCommand import RestartCommand
class CommandManager: class CommandManager:
@ -10,6 +11,7 @@ class CommandManager:
self.addCommand(AddCommand()) self.addCommand(AddCommand())
self.addCommand(RemoveCommand()) self.addCommand(RemoveCommand())
self.addCommand(ListCommand()) self.addCommand(ListCommand())
self.addCommand(RestartCommand())
pass pass
def addCommand(self, command): def addCommand(self, command):

@ -31,6 +31,6 @@ class AddCommand(Command):
traefikConfig.save() traefikConfig.save()
restartTraefik() # restartTraefik()
print(f"Access your service at http://{domain}") print(f"Access your service at http://{domain}")

@ -0,0 +1,10 @@
from command.command import Command
from traefik.traefikConfig import TraefikConfig
from utils.dockerUtils import restartTraefik
class RestartCommand(Command):
def __init__(self):
super().__init__("restart", "Restart traefik", "")
def execute(self, traefikConfig: TraefikConfig, args):
restartTraefik()