add restart command
All checks were successful
Publish Docker Image / docker (push) Successful in 2m53s
All checks were successful
Publish Docker Image / docker (push) Successful in 2m53s
This commit is contained in:
parent
4ee7337e9d
commit
cacdf1f5b9
@ -1,6 +1,7 @@
|
||||
from command.impl.addCommand import AddCommand
|
||||
from command.impl.listCommand import ListCommand
|
||||
from command.impl.removeCommand import RemoveCommand
|
||||
from command.impl.restartCommand import RestartCommand
|
||||
|
||||
class CommandManager:
|
||||
|
||||
@ -10,6 +11,7 @@ class CommandManager:
|
||||
self.addCommand(AddCommand())
|
||||
self.addCommand(RemoveCommand())
|
||||
self.addCommand(ListCommand())
|
||||
self.addCommand(RestartCommand())
|
||||
pass
|
||||
|
||||
def addCommand(self, command):
|
||||
|
@ -6,7 +6,7 @@ class AddCommand(Command):
|
||||
def __init__(self):
|
||||
super().__init__("add", "Add a domain", "add <name> <domain> <service host>")
|
||||
|
||||
def execute(self, traefikConfig:TraefikConfig, args):
|
||||
def execute(self, traefikConfig: TraefikConfig, args):
|
||||
if len(args) < 3:
|
||||
self.printUsage()
|
||||
return
|
||||
@ -31,6 +31,6 @@ class AddCommand(Command):
|
||||
|
||||
traefikConfig.save()
|
||||
|
||||
restartTraefik()
|
||||
# restartTraefik()
|
||||
|
||||
print(f"Access your service at http://{domain}")
|
@ -6,7 +6,7 @@ class ListCommand(Command):
|
||||
def __init__(self):
|
||||
super().__init__("list", "List all services", "list")
|
||||
|
||||
def execute(self, traefikConfig:TraefikConfig, args):
|
||||
def execute(self, traefikConfig: TraefikConfig, args):
|
||||
print("Listing all services:")
|
||||
|
||||
domains = traefikConfig.getAll()
|
||||
|
@ -7,7 +7,7 @@ class RemoveCommand(Command):
|
||||
def __init__(self):
|
||||
super().__init__("remove", "Remove a domain", "remove <name>")
|
||||
|
||||
def execute(self, traefikConfig:TraefikConfig, args):
|
||||
def execute(self, traefikConfig: TraefikConfig, args):
|
||||
if len(args) < 0:
|
||||
self.printUsage()
|
||||
return
|
||||
|
10
src/command/impl/restartCommand.py
Normal file
10
src/command/impl/restartCommand.py
Normal file
@ -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()
|
Loading…
Reference in New Issue
Block a user