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
102 lines (88 loc) · 1.95 KB
/
taskfile.yml
File metadata and controls
102 lines (88 loc) · 1.95 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
version: "3.0"
set: ['e', 'u', 'pipefail']
shopt: ['globstar']
dotenv: ['.env']
env:
TLD:
sh: git rev-parse --show-toplevel
APP:
sh: echo "${APP_NAME:-mvp}"
POETRY:
sh: "echo ${POETRY:-1.7.1}"
PY_VER:
sh: "echo ${PY_VER:-3.11.6}"
SCRIPT:
UNAME:
sh: "uname -s"
vars:
includes:
docker:
taskfile: ./taskfiles/docker.yml
aliases: ["docker"]
poetry:
taskfile: ./taskfiles/poetry.yml
aliases: ["poetry"]
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
pre-commit:
desc: "Run pre-commit hooks"
cmds:
- pre-commit run --all-files
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
checkbash:
desc: "Check bash scripts"
cmds:
- checkbashism -x {{.TLD}}/app/*.sh