-
Notifications
You must be signed in to change notification settings - Fork 47
/
derrick
executable file
·94 lines (91 loc) · 2.13 KB
/
derrick
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/bash -e
function dcr {
docker-compose run --rm web $@
}
function dcrq {
docker-compose run --rm --no-deps web $@
}
case "$1" in
"up")
docker-compose up
;;
"down")
docker-compose down
;;
"build")
docker-compose build
;;
"manage")
dcr python manage.py "${@:2}"
;;
"populate")
dcr python manage.py populate_data "${@:2}"
;;
"truncate")
dcr python manage.py truncate_data "${@:2}"
;;
"lint")
dcrq yarn lint "${@:2}"
;;
"lint:py")
dcrq yarn lint:py "${@:2}"
;;
"lint:js")
dcrq yarn lint:js "${@:2}"
;;
"test")
dcr yarn test "${@:2}"
;;
"test:js:watch")
dcrq yarn test:js:watch "${@:2}"
;;
"test:py")
dcr yarn test:py "${@:2}"
;;
"test:js")
dcrq yarn test:js "${@:2}"
;;
"storybook")
docker-compose run --rm --no-deps --service-ports web yarn storybook "${@:2}"
;;
"add:js")
dcrq yarn add "${@:2}"
;;
"lock:py")
dcrq pip-compile --upgrade --output-file=requirements/prod.txt requirements/prod.in
dcrq pip-compile --upgrade --output-file=requirements/dev.txt requirements/dev.in
;;
"migrate")
dcr python manage.py migrate "${@:2}"
;;
"makemigrations")
dcr python manage.py makemigrations "${@:2}"
;;
"showmigrations")
dcr python manage.py showmigrations "${@:2}"
;;
"messages")
dcr python manage.py makemessages --locale "${@:2}"
dcr python manage.py compilemessages
;;
"shell" | "bash" | "sh")
dcr bash "${@:2}"
;;
"ipy")
dcr python manage.py shell "${@:2}"
;;
"dbshell")
dcr python manage.py dbshell "${@:2}"
;;
"manage")
dcr python manage.py "${@:2}"
;;
"prune")
# See https://docs.docker.com/config/pruning/ for more detail.
docker system prune -f --volumes
;;
*)
echo "Sorry, I don't know that command."
exit 1
;;
esac