-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrun.py
executable file
·37 lines (29 loc) · 889 Bytes
/
run.py
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
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python
import os
import argparse
def run():
""" Reuse the Procfile to start the dev server """
with open("Procfile", "r") as f:
command = f.read().strip()
command = command.replace("web: ", "")
command += " --reload"
os.system(command)
def deploy():
os.system("git push dokku master")
def dependencies():
os.system("pip-compile --upgrade requirements.in")
os.system("pip-compile --upgrade requirements-dev.in")
os.system("pip-sync requirements-dev.txt")
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--deploy', action="store_true", required=False)
parser.add_argument('--deps', action="store_true", required=False)
args = parser.parse_args()
if args.deploy:
deploy()
elif args.deps:
dependencies()
else:
run()
if __name__ == '__main__':
main()