Pass env vars and volumes from the backup container to the backup process container

This commit is contained in:
Einar Forselv 2019-04-18 04:44:10 +02:00
parent 58b3220a2e
commit 15c91d5970
1 changed files with 4 additions and 4 deletions

View File

@ -34,20 +34,20 @@ def main():
# TODO: Errors when repo already exists # TODO: Errors when repo already exists
restic.init_repo(config.repository) restic.init_repo(config.repository)
print(containers.this_container.environment)
print("Starting backup container..") print("Starting backup container..")
backup_runner.run( backup_runner.run(
image=containers.this_container.image, image=containers.this_container.image,
command='restic-volume-backup start-backup-process', command='restic-volume-backup start-backup-process',
volumes={}, volumes=containers.this_container.volumes,
enviroment={}, enviroment=containers.this_container.environment,
labels={"restic-volume-backup.backup_process": 'True'}, labels={"restic-volume-backup.backup_process": 'True'},
) )
# Separate command to avoid spawning infinite containers :) # Separate command to avoid spawning infinite containers :)
elif args.action == 'start-backup-process': elif args.action == 'start-backup-process':
print("start-backup-process") print("start-backup-process")
import os
print(os.environ)
def parse_args(): def parse_args():