-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
65 lines (62 loc) · 1.29 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
# https://taskfile.dev
version: '3'
tasks:
venv.create:
desc: Create virtual environment
cmds:
- python -m venv .venv
install:
desc: Install dependencies
run: once
cmds:
- poetry install
update:
desc: Update dependencies
cmds:
- poetry update
clean:
desc: Clean up
cmds:
- rm -f output.txt
- rm -f *.db*
setup.year:
desc: Setup for the year
cmds:
- |
for day in $(seq -w 1 25); do
task setup.day DAY=$day YEAR={{.YEAR}}
done
requires:
vars: [ YEAR ]
setup.day:
desc: Setup for the day
status:
- |
[ -f "{{.NAME}}.ipynb" ]
cmds:
- mkdir -p "{{.YEAR}}"
- cat template.ipynb | sed "s/<<DAY>>/{{.DAY}}/g" | sed "s/<<YEAR>>/{{.YEAR}}/g" > "{{.NAME}}.ipynb"
- git add "{{.NAME}}.ipynb"
vars:
NAME: "{{.YEAR}}/day_{{.DAY}}"
requires:
vars: [ DAY, YEAR ]
setup.today:
desc: Setup for today
cmds:
- task: setup.day
vars:
DAY:
sh: date "+%d"
YEAR:
sh: date "+%Y"
day.run.all:
desc: Run all days
dir: "{{.YEAR}}"
cmds:
- |
for i in day_*.ipynb; do
jupyter execute --inplace $i;
done
requires:
vars: [ YEAR ]