From e55312585488516061a89df4dea724a36b7915dc Mon Sep 17 00:00:00 2001 From: Einar Forselv Date: Thu, 18 Apr 2019 05:08:35 +0200 Subject: [PATCH] backup process container should belong to the current project --- restic_volume_backup/cli.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/restic_volume_backup/cli.py b/restic_volume_backup/cli.py index 73fbc0b..38cc573 100644 --- a/restic_volume_backup/cli.py +++ b/restic_volume_backup/cli.py @@ -23,13 +23,6 @@ def main(): start_backup_process(config, containers) -def start_backup_process(config, containers): - """Start the backup process container""" - print("start-backup-process") - import os - print(os.environ) - - def status(config, containers): """Outputs the backup config for the compse setup""" print() @@ -61,10 +54,19 @@ def backup(config, containers): command='restic-volume-backup start-backup-process', volumes=containers.this_container.volumes, enviroment=containers.this_container.environment, - labels={"restic-volume-backup.backup_process": 'True'}, + labels={ + "restic-volume-backup.backup_process": 'True', + "com.docker.compose.project": containers.this_container.project_name, + }, ) +def start_backup_process(config, containers): + """Start the backup process container""" + print("start-backup-process") + status(config, containers) + + def parse_args(): parser = argparse.ArgumentParser(prog='restic_volume_backup') parser.add_argument(