-
Notifications
You must be signed in to change notification settings - Fork 0
/
taskfile.yml
125 lines (109 loc) · 2.57 KB
/
taskfile.yml
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
115
116
117
118
119
120
121
122
123
124
125
version: "3.0"
set: ['e', 'u', 'pipefail']
shopt: ['globstar']
dotenv: ['./app/.env']
env:
TLD: "{{.ROOT_DIR}}"
APP:
sh: echo "${APP_NAME:-meetup_bot}"
POETRY:
sh: "echo ${POETRY:-1.8.3}"
PY_VER:
sh: "echo ${PY_VER:-3.11.9}"
SCRIPT:
sh: "echo ${SCRIPT:-scheduler.sh}"
UNAME:
sh: "uname -s"
vars:
includes:
docker:
taskfile: ./taskfiles/docker.yml
aliases: ["docker"]
heroku:
taskfile: ./taskfiles/heroku.yml
aliases: ["heroku"]
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 "HEROKU_APP:\t{{.HEROKU_APP}}"
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:
- |
{{.INSTALL}} {{.CLI_ARGS}}
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
update-deps:
desc: "Update dependencies"
cmds:
- |
poetry cache clear --all pypi --no-ansi
poetry update --lock --no-ansi
export-reqs:
desc: "Export requirements.txt"
summary: |
Export the project dependencies to a requirements.txt file.
cmds:
- |
poetry export -f requirements.txt \
--output {{.TLD}}/requirements.txt \
--without-hashes \
--no-ansi
ignore_error: true