|
@@ -207,12 +207,12 @@ class CliArguments:
|
|
|
subparsers = parser.add_subparsers()
|
|
subparsers = parser.add_subparsers()
|
|
|
|
|
|
|
|
for sub in [
|
|
for sub in [
|
|
|
- CliArgumentsStart,
|
|
|
|
|
- CliArgumentsRm,
|
|
|
|
|
- CliArgumentsBash,
|
|
|
|
|
- CliArgumentsCreateRepo,
|
|
|
|
|
- CliArgumentsExportKey,
|
|
|
|
|
- CliArgumentsCreateSecrets
|
|
|
|
|
|
|
+ CommandStart,
|
|
|
|
|
+ CommandRm,
|
|
|
|
|
+ CommandBash,
|
|
|
|
|
+ CommandCreateRepo,
|
|
|
|
|
+ CommandExportKey,
|
|
|
|
|
+ CommandCreateSecrets
|
|
|
]:
|
|
]:
|
|
|
p = subparsers.add_parser(sub.command, help=sub.help)
|
|
p = subparsers.add_parser(sub.command, help=sub.help)
|
|
|
sub.init_subparser(p)
|
|
sub.init_subparser(p)
|
|
@@ -222,28 +222,28 @@ class CliArguments:
|
|
|
return args.type_(args)
|
|
return args.type_(args)
|
|
|
|
|
|
|
|
|
|
|
|
|
-class CliArgumentsStart(CliArguments):
|
|
|
|
|
|
|
+class CommandStart(CliArguments):
|
|
|
command = "start"
|
|
command = "start"
|
|
|
help = "start container"
|
|
help = "start container"
|
|
|
|
|
|
|
|
def run(self, *, container: BorgmaticContainer, data_sources: list[Path], secret_sources: list[Secret], **kwargs):
|
|
def run(self, *, container: BorgmaticContainer, data_sources: list[Path], secret_sources: list[Secret], **kwargs):
|
|
|
container.run(data_sources, secret_sources)
|
|
container.run(data_sources, secret_sources)
|
|
|
|
|
|
|
|
-class CliArgumentsRm(CliArguments):
|
|
|
|
|
|
|
+class CommandRm(CliArguments):
|
|
|
command = "rm"
|
|
command = "rm"
|
|
|
help = "remove container"
|
|
help = "remove container"
|
|
|
|
|
|
|
|
def run(self, *, container: BorgmaticContainer, **kwargs):
|
|
def run(self, *, container: BorgmaticContainer, **kwargs):
|
|
|
container.rm()
|
|
container.rm()
|
|
|
|
|
|
|
|
-class CliArgumentsBash(CliArguments):
|
|
|
|
|
|
|
+class CommandBash(CliArguments):
|
|
|
command = "bash"
|
|
command = "bash"
|
|
|
help = "run shell in container"
|
|
help = "run shell in container"
|
|
|
|
|
|
|
|
def run(self, *, container: BorgmaticContainer, **kwargs):
|
|
def run(self, *, container: BorgmaticContainer, **kwargs):
|
|
|
container.exec(["bash"])
|
|
container.exec(["bash"])
|
|
|
|
|
|
|
|
-class CliArgumentsCreateRepo(CliArguments):
|
|
|
|
|
|
|
+class CommandCreateRepo(CliArguments):
|
|
|
command = "create_repo"
|
|
command = "create_repo"
|
|
|
help = "create repository"
|
|
help = "create repository"
|
|
|
env_vars=["BORG_PASSPHRASE_NAME", "STORAGE_BOX_USER", "SSH_KEY_NAME"]
|
|
env_vars=["BORG_PASSPHRASE_NAME", "STORAGE_BOX_USER", "SSH_KEY_NAME"]
|
|
@@ -251,7 +251,7 @@ class CliArgumentsCreateRepo(CliArguments):
|
|
|
def run(self, *, container: BorgmaticContainer, **kwargs):
|
|
def run(self, *, container: BorgmaticContainer, **kwargs):
|
|
|
container.exec(["borgmatic", "repo-create", "--encryption", "repokey"], self.env_vars)
|
|
container.exec(["borgmatic", "repo-create", "--encryption", "repokey"], self.env_vars)
|
|
|
|
|
|
|
|
-class CliArgumentsExportKey(CliArguments):
|
|
|
|
|
|
|
+class CommandExportKey(CliArguments):
|
|
|
command = "export_key"
|
|
command = "export_key"
|
|
|
help = "export the repository key"
|
|
help = "export the repository key"
|
|
|
env_vars=["BORG_PASSPHRASE_NAME", "STORAGE_BOX_USER", "SSH_KEY_NAME"]
|
|
env_vars=["BORG_PASSPHRASE_NAME", "STORAGE_BOX_USER", "SSH_KEY_NAME"]
|
|
@@ -259,7 +259,7 @@ class CliArgumentsExportKey(CliArguments):
|
|
|
def run(self, *, container: BorgmaticContainer, **kwargs):
|
|
def run(self, *, container: BorgmaticContainer, **kwargs):
|
|
|
container.exec(["borgmatic", "export", "key"], self.env_vars)
|
|
container.exec(["borgmatic", "export", "key"], self.env_vars)
|
|
|
|
|
|
|
|
-class CliArgumentsCreateSecrets(CliArguments):
|
|
|
|
|
|
|
+class CommandCreateSecrets(CliArguments):
|
|
|
command="create_secrets"
|
|
command="create_secrets"
|
|
|
help="create podman secrets"
|
|
help="create podman secrets"
|
|
|
|
|
|