-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #185 from openradx/replace-invoke-with-typer
Replace invoke with typer
- Loading branch information
Showing
21 changed files
with
189 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#! /usr/bin/env python3 | ||
|
||
from pathlib import Path | ||
from typing import Annotated | ||
|
||
import typer | ||
from adit_radis_shared import cli_commands as commands | ||
from adit_radis_shared import cli_helpers as helpers | ||
|
||
helpers.PROJECT_ID = "adit" | ||
helpers.ROOT_PATH = Path(__file__).resolve().parent | ||
|
||
app = typer.Typer() | ||
|
||
extra_args = {"allow_extra_args": True, "ignore_unknown_options": True} | ||
|
||
app.command()(commands.init_workspace) | ||
app.command()(commands.compose_up) | ||
app.command()(commands.compose_down) | ||
app.command()(commands.stack_deploy) | ||
app.command()(commands.stack_rm) | ||
app.command()(commands.lint) | ||
app.command()(commands.format_code) | ||
app.command(context_settings=extra_args)(commands.test) | ||
app.command()(commands.show_outdated) | ||
app.command()(commands.backup_db) | ||
app.command()(commands.restore_db) | ||
app.command()(commands.shell) | ||
app.command()(commands.generate_certificate_files) | ||
app.command()(commands.generate_certificate_chain) | ||
app.command()(commands.generate_django_secret_key) | ||
app.command()(commands.generate_secure_password) | ||
app.command()(commands.generate_auth_token) | ||
app.command()(commands.randomize_env_secrets) | ||
app.command()(commands.try_github_actions) | ||
|
||
|
||
@app.command() | ||
def populate_orthancs( | ||
reset: Annotated[bool, typer.Option(help="Do not build images")] = False, | ||
simulate: Annotated[bool, typer.Option(help="Simulate the command")] = False, | ||
): | ||
"""Populate Orthancs with example DICOMs""" | ||
|
||
cmd = f"{helpers.build_compose_cmd()} exec web python manage.py populate_orthancs" | ||
if reset: | ||
cmd += " --reset" | ||
|
||
helpers.execute_cmd(cmd, simulate=simulate) | ||
|
||
|
||
if __name__ == "__main__": | ||
app() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Backups | ||
|
||
For database backups django-dbbackup app is used. The backups are done every night at 3 am by a periodic task using the dbbackup management command and stored in the `backups` directory which is mounted as a volume. The dbbackup command can also be called manually with `invoke backup_db`. | ||
For database backups django-dbbackup app is used. The backups are done every night at 3 am by a periodic task using the dbbackup management command and stored in the `backups` directory which is mounted as a volume. The dbbackup command can also be called manually with `poetry run ./cli.py backup-db`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.