Skip to content

Commit

Permalink
Separate command to reset Orthancs
Browse files Browse the repository at this point in the history
  • Loading branch information
medihack authored Aug 8, 2023
1 parent 9b48cb9 commit 4e1c413
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,16 +236,22 @@ def ci(ctx: Context):
def reset_adit_dev(ctx: Context):
"""Reset ADIT dev container environment"""
# Reset Orthancs
reset_orthancs_cmd = f"{build_compose_cmd('dev')} exec web python manage.py reset_orthancs"
run_cmd(ctx, reset_orthancs_cmd)
reset_orthancs(ctx, "dev")
# Wipe the database
flush_cmd = f"{build_compose_cmd('dev')} exec web python manage.py flush --noinput"
run_cmd(ctx, flush_cmd)
# Populate the database with example data
# Re-populate the database with example data
populate_dev_db_cmd = f"{build_compose_cmd('dev')} exec web python manage.py populate_dev_db"
run_cmd(ctx, populate_dev_db_cmd)


@task
def reset_orthancs(ctx: Context, env: Environments = "dev"):
"""Reset Orthancs"""
cmd = f"{build_compose_cmd(env)} exec web python manage.py reset_orthancs"
run_cmd(ctx, cmd)


@task
def adit_web_shell(ctx: Context, env: Environments = "dev"):
"""Open Python shell in ADIT web container of specified environment"""
Expand Down

0 comments on commit 4e1c413

Please sign in to comment.