Add purge-volumes command
This commit is contained in:
parent
08b19f76eb
commit
0b85097295
12
alakazam.py
12
alakazam.py
|
@ -695,6 +695,18 @@ def purge_secrets(apps):
|
|||
abra("app","secret" ,"rm", "-a", domain)
|
||||
print(f"Secrets for {domain} purged")
|
||||
|
||||
@cli.command()
|
||||
@click.option('-a', '--apps', multiple=True)
|
||||
def purge_volumes(apps):
|
||||
""" Remove all the apps secrets """
|
||||
# TODO: check for deployed apps
|
||||
pool_apps = print_all_apps(apps)
|
||||
domains = list(zip(*sum(pool_apps.values(), [])))[1]
|
||||
if input(f"Do you really want to purge the volumes for these apps? Type YES: ") == "YES":
|
||||
for domain in domains:
|
||||
logging.info(f'purge {domain}')
|
||||
abra("app","volume" ,"rm", "-n", domain)
|
||||
print(f"Volumes for {domain} purged")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Reference in New Issue