Adding dev script for easier testing workflow
This commit is contained in:
parent
b4aa323577
commit
8f67333050
27
dev.py
Executable file
27
dev.py
Executable file
@ -0,0 +1,27 @@
|
|||||||
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
from subprocess import run
|
||||||
|
from argparse import ArgumentParser
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
parser = ArgumentParser()
|
||||||
|
parser.add_argument(
|
||||||
|
'-i',
|
||||||
|
'--init-db',
|
||||||
|
help='Run the admin cli to setup the db backend',
|
||||||
|
action='store_true'
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
'-d',
|
||||||
|
'--db-url',
|
||||||
|
help='Sets the database URL to use for connecting to postgres',
|
||||||
|
default='postgres://psql:example@localhost:5432'
|
||||||
|
)
|
||||||
|
args = parser.parse_args()
|
||||||
|
env = os.environ
|
||||||
|
if args.init_db:
|
||||||
|
run('cargo run --bin admin-cli -- --setup'.split(), env=env)
|
||||||
|
else:
|
||||||
|
print('Nothing to do')
|
Loading…
Reference in New Issue
Block a user