-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yaml
127 lines (106 loc) · 2.77 KB
/
Taskfile.yaml
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
126
127
version: '3'
vars:
DOCKER_COMPOSE: "docker-compose"
DOCKER_COMPOSE_ARGS: "-p eda -f tools/docker/docker-compose.yaml"
DJANGO_SETTINGS_MODULE: "aap_eda.settings.development"
tasks:
default:
desc: "Show this message and exit"
cmds:
- task -l
silent: true
dev:init:
desc: "Initialize local development environment"
cmds:
- cmd: poetry install --with=dev
- cmd: poetry run pre-commit install
manage:
desc: "Run django management command"
cmds:
# This is a workaround for poetry incorrectly passing argv[0] to spawned subprocess
# See https://github.com/python-poetry/poetry/issues/965
- cmd: poetry run /usr/bin/env bash -c "aap-eda-manage" {{.CLI_ARGS}}
test:
desc: "Run project tests."
cmds:
- poetry run python -m pytest
lint:
desc: "Run all linters."
cmds:
- task: lint:black
- task: lint:isort
- task: lint:ruff
- task: lint:flake8
lint:black:
desc: "Check code with `black`."
cmds:
- poetry run black --check -- {{.CLI_ARGS | default "."}}
lint:isort:
desc: "Check code with `isort`."
cmds:
- poetry run isort --check -- {{.CLI_ARGS | default "."}}
lint:ruff:
desc: "Check code with `flake8`."
cmds:
- poetry run ruff -- {{.CLI_ARGS | default "."}}
lint:flake8:
desc: "Check code with `flake8`."
cmds:
- poetry run flake8 -- {{.CLI_ARGS | default "."}}
format:
desc: "Run code formatters"
cmds:
- task: format:isort
- task: format:black
format:isort:
desc: "Format code with `isort`."
cmds:
- poetry run black .
format:black:
desc: "Format code with `black`."
cmds:
- poetry run isort .
docker:
desc: "Run docker-compose with specified CLI arguments."
summary: |
Run docker-compose with specified CLI arguments.
Example:
$ task docker -- ls
cmds:
- '{{.DOCKER_COMPOSE}} {{.DOCKER_COMPOSE_ARGS}} {{.CLI_ARGS}}'
docker:build:
desc: "Build container images."
cmds:
- task: docker
vars:
CLI_ARGS: build
docker:up:
desc: "Start all services."
cmds:
- task: docker
vars:
CLI_ARGS: up --detach
docker:up:postgres:
desc: "Start PostgreSQL service."
cmds:
- task: docker
vars:
CLI_ARGS: up --detach postgres
docker:down:
desc: "Stop all services."
cmds:
- task: docker
vars:
CLI_ARGS: down
docker:purge:
desc: "Stop all containers and delete all volumes."
cmds:
- task: docker
vars:
CLI_ARGS: down --volumes
docker:psql:
desc: "Open PostgreSQL console."
cmds:
- task: docker
vars:
CLI_ARGS: exec postgres psql -U postgres eda