Repository navigation
Expand file tree
/
Copy pathdev
More file actions
executable file
·88 lines (74 loc) · 1.43 KB
/
Copy pathdev
File metadata and controls
executable file
·88 lines (74 loc) · 1.43 KB
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
#!/usr/bin/env bash
set -euo pipefail
built_image_name="uaa-bot"
main() {
[[ $# -eq 0 ]] && usage "Expected command."
cd "$(git rev-parse --show-toplevel)"
command="$1"
shift
case $command in
-h)
usage
;;
black)
black
;;
install-all-reqs)
install-all-reqs
;;
install-prod-reqs)
install-prod-reqs
;;
tests)
tests
;;
watch-tests)
watch-tests
;;
update-requirements)
update-requirements
install-all-reqs
;;
*)
usage "Unknown command: $command"
;;
esac
}
black() {
python -m black uaa_bot tests cli
}
install-all-reqs() {
pip install -r pip-tools/dev-requirements.txt
}
install-prod-reqs() {
pip install -r requirements.txt
}
tests() {
python -m pytest -Werror -vv
}
watch-tests() {
rptw --spool=1000 -n -c -w -- -Werror -vv
}
update-requirements() {
bash `pwd`/update-requirements.sh "$@"
}
usage() {
[[ $# -gt 0 ]] && echo "ERROR: $*"
local me=$(basename "$0")
cat <<-EOF
USAGE: $me COMMAND
Run workflows.
This provides a consistent developer experience, and avoids the "works on my
laptop" issue.
Examples:
# Same as above
$me tests
# Continually watch for file changes and runs tests
$me watch-tests
# Generate the pip-tools/*requirements.txt files from
# pip-tools/*requirements.in
$me update-requirements [--upgrade]
EOF
exit 1
}
main "$@"