-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmain.py
More file actions
26 lines (21 loc) 路 707 Bytes
/
Copy pathmain.py
File metadata and controls
26 lines (21 loc) 路 707 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import argparse
from src.apps.backoffice.boot import boot as boot_backoffice
from src.apps.photostore.boot import boot as boot_photostore
service_mapping = {
'backoffice': boot_backoffice,
'photostore': boot_photostore,
}
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
'--service',
type=str,
nargs='?',
help='Service to run must be one of ["backoffice", "photostore"]',
)
params = vars(parser.parse_args())
service_name = params['service']
service_booter = service_mapping[service_name]
print(f'Booting {service_name} server')
service_booter()
print(f'{service_name} server start success')