Skip to content

Commit

Permalink
Add dellar_list and dellar_remove commands
Browse files Browse the repository at this point in the history
  • Loading branch information
engineervix committed Jan 8, 2024
1 parent 2e816e8 commit 220fc87
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions fabfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,29 @@ def dellar_restore(c, filename):
print("Database restored.")


@task
def dellar_list(c):
"""List available database snapshots"""
print("Database snapshots:")
dexec(
"""for f in *.psql; do
printf ' - %s\n' "${f%.psql}"
done""",
service="db",
),
print("Restore with `dellar-restore <snapshot>`")


@task
def dellar_remove(c, filename):
"""Remove database snapshots"""
dexec(
"rm {filename}.psql".format(filename=filename),
service="db",
),
print(f"Snapshot {filename} removed")


def get_heroku_variable(c, app_instance, variable):
return local(
"heroku config:get {var} --app {app}".format(app=app_instance, var=variable)
Expand Down

0 comments on commit 220fc87

Please sign in to comment.