forked from coop-cloud/backup-bot-two
breaking change: rename env RESTIC_REPO to RESTIC_REPOSITORY
This commit is contained in:
@ -23,13 +23,13 @@ SERVICE = None
|
||||
@click.group()
|
||||
@click.option('-l', '--log', 'loglevel')
|
||||
@click.option('service', '--host', '-h', envvar='SERVICE')
|
||||
@click.option('repository', '--repo', '-r', envvar='RESTIC_REPO', required=True)
|
||||
@click.option('repository', '--repo', '-r', envvar='RESTIC_REPOSITORY', required=True)
|
||||
def cli(loglevel, service, repository):
|
||||
global SERVICE
|
||||
if service:
|
||||
SERVICE = service.replace('.', '_')
|
||||
if repository:
|
||||
os.environ['RESTIC_REPO'] = repository
|
||||
os.environ['RESTIC_REPOSITORY'] = repository
|
||||
if loglevel:
|
||||
numeric_level = getattr(logging, loglevel.upper(), None)
|
||||
if not isinstance(numeric_level, int):
|
||||
@ -40,7 +40,7 @@ def cli(loglevel, service, repository):
|
||||
|
||||
|
||||
def init_repo():
|
||||
repo = os.environ['RESTIC_REPO']
|
||||
repo = os.environ['RESTIC_REPOSITORY']
|
||||
logging.debug(f"set restic repository location: {repo}")
|
||||
restic.repository = repo
|
||||
restic.password_file = '/var/run/secrets/restic_password'
|
||||
|
Reference in New Issue
Block a user