generated from pythoninthegrasses/mvp
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtaskfile.yml
More file actions
114 lines (100 loc) · 2.24 KB
/
taskfile.yml
File metadata and controls
114 lines (100 loc) · 2.24 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
version: "3.0"
set: ['e', 'pipefail']
shopt: ['globstar']
dotenv: ['.env']
env:
TLD:
sh: git rev-parse --show-toplevel
APP:
sh: echo "${APP_NAME:-pytest-demo}"
PORT:
sh: "echo ${PORT:-8080}"
UNAME:
sh: "uname -s"
vars:
includes:
docker:
taskfile: ./taskfiles/docker.yml
aliases: ["docker"]
poetry:
taskfile: ./taskfiles/poetry.yml
aliases: ["poetry"]
playwright:
taskfile: ./taskfiles/playwright.yml
aliases: ["pw"]
tasks:
print:
- |
echo -e "TLD:\t\t$TLD"
echo -e "APP:\t\t{{.APP}}"
echo -e "BUILD:\t\t{{.BUILD}}"
echo -e "COMPOSE_FILE:\t{{.COMPOSE_FILE}}"
echo -e "DOCKERFILE:\t{{.DOCKERFILE}}"
echo -e "PLATFORM:\t{{.PLATFORM}}"
echo -e "POETRY:\t\t{{.POETRY}}"
echo -e "PY_VER:\t\t{{.PY_VER}}"
echo -e "SCRIPT:\t\t{{.SCRIPT}}"
echo -e "REGISTRY:\t$REGISTRY"
echo -e "SERVICE:\t{{.SERVICE}}"
echo -e "TAG:\t\t${TAG}"
echo -e "USER_NAME:\t$USER_NAME"
echo -e "UNAME:\t\t$UNAME"
default:
desc: "Default task"
cmds:
- task --list
install:
desc: "Install project dependencies"
cmds:
- make install
serve:
desc: "Run the server"
cmds:
- |
case "{{.CLI_ARGS}}" in
start)
poetry run python server.py start
;;
stop)
poetry run python server.py stop
;;
*)
echo "Usage: task serve -- <start|stop>"
;;
esac
dir: "{{.TLD}}/app"
ignore_error: true
lint:
desc: "Run linters"
cmds:
- poetry run ruff check --fix --respect-gitignore
format:
desc: "Run formatters"
cmds:
- poetry run ruff format --respect-gitignore
test:
desc: "Run tests"
cmds:
- poetry run pytest
pyclean:
desc: "Remove .pyc and __pycache__"
cmds:
- |
args=(
.
--debris
--verbose
-i .devbox
)
case "{{.CLI_ARGS}}" in
dry-run)
poetry run pyclean "${args[@]}" --dry-run
;;
*)
poetry run pyclean "${args[@]}"
;;
esac
pre-commit:
desc: "Run pre-commit hooks"
cmds:
- pre-commit run --all-files