add logs command
All checks were successful
Publish Docker Image / docker (push) Successful in 1m30s
All checks were successful
Publish Docker Image / docker (push) Successful in 1m30s
This commit is contained in:
parent
9ca94d0e05
commit
2c0d4cdcae
@ -2,6 +2,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
|
||||
from command.impl.logsCommand import LogsCommand
|
||||
|
||||
class CommandManager:
|
||||
|
||||
@ -12,6 +13,7 @@ class CommandManager:
|
||||
self.addCommand(RemoveCommand())
|
||||
self.addCommand(ListCommand())
|
||||
self.addCommand(RestartCommand())
|
||||
self.addCommand(LogsCommand())
|
||||
pass
|
||||
|
||||
def addCommand(self, command):
|
||||
|
10
src/command/impl/logsCommand.py
Normal file
10
src/command/impl/logsCommand.py
Normal file
@ -0,0 +1,10 @@
|
||||
from command.command import Command
|
||||
from traefik.traefikConfig import TraefikConfig
|
||||
from utils.dockerUtils import getTraefikLogs
|
||||
|
||||
class LogsCommand(Command):
|
||||
def __init__(self):
|
||||
super().__init__("logs", "Get traefik logs", "logs")
|
||||
|
||||
def execute(self, traefikConfig: TraefikConfig, args):
|
||||
getTraefikLogs()
|
@ -16,3 +16,7 @@ def restartTraefik():
|
||||
subprocess.run(["docker", "restart", containerName])
|
||||
|
||||
print("Done!")
|
||||
|
||||
def getTraefikLogs():
|
||||
print("Getting Traefik logs, please wait...")
|
||||
subprocess.run(["docker", "logs", containerName, "-f"])
|
Loading…
Reference in New Issue
Block a user