-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtaskfile.yaml
95 lines (81 loc) · 1.97 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
version: '3'
tasks:
flake-check:
desc: check whether the flake evaluates and run its tests
cmds:
- nix flake check
flake-update-all:
desc: update all flake inputs
cmds:
- printf "\n> Updating all flake inputs\n\n"
- nix flake update
silent: true
flake-update-one:
desc: update one flake imput like nixpkgs or flake-utils
cmds:
- printf "\n> Updating flake input {{.CLI_ARGS}}\n\n"
- nix flake lock --update-input {{.CLI_ARGS}}
silent: true
pre-commit:
desc: inizialize pre-commit
cmds:
- pre-commit install
sources:
- .git/hooks/pre-commit
- .pre-commit-config.yaml
generates:
- .git/hooks/pre-commit
method: checksum
pytest:
desc: run pytest
cmds:
- pytest -v -s
coverage:
desc: create coverage report
cmds:
- pytest --cov=lotb --cov-report=term-missing
mypy:
desc: run mypy
cmds:
- mypy lotb
fmt:
desc: run ruff
cmds:
- ruff check --fix
- ruff format
local:
desc: run the app locally
cmds:
- nix run .#lotb -- --config config.yaml
docker-version:
desc: temp ovverride ver in pyproject.toml if OVERRIDE_VERSION
silent: true
cmds:
- |
if [ -n "$OVERRIDE_VERSION" ]; then
sed -i '3s/^version = "[^"]*"/version = "'"$OVERRIDE_VERSION"'"/' pyproject.toml;
fi
docker-build:
desc: build docker img from nix
deps:
- docker-version
cmds:
- nix build .#dockerimg
- docker load < result
docker-push:
desc: docker push
silent: true
cmds:
- |
export IMAGE=$(docker images | grep -E "lotb" | awk '{print $1":"$2}' | head -n 1)
docker push $IMAGE
docker-compose-recreate:
desc: restart container
cmds:
- docker compose down
- docker compose up -d
docker-revamp:
desc: rebuild and restart container
cmds:
- task: docker-build
- task: docker-compose-recreate