forked from feluelle/airflow-diagrams
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
37 lines (36 loc) · 1.82 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
version: '3'
tasks:
demo:
vars:
COMMAND: airflow-diagrams generate --airflow-dag-id dbt -o examples/
cmds:
# 1. Record demo as json
- source .venv/bin/activate && asciinema rec assets/json/demo_output.json -c "{{ .COMMAND }}" --overwrite
# 2. Combine previous demo output and command
- echo "{{ .COMMAND }}" | .venv/bin/python3 dev/demo/demo_editor.py
# 3. Convert demo to svg
- docker run --rm -i -v $PWD/assets:/data bric3/svg-term-cli svg-term --in /data/json/demo_full.json --out /data/images/demo.svg --window --width 100
# 4. Render diagram
- cd examples && ../.venv/bin/python3 dbt_diagrams.py
airflow-download:
cmds:
# Pull latest data from airflow repo if exists else clone airflow repo
- cd generated/airflow && git fetch && git pull || gh repo clone apache/airflow generated/airflow
fake-dag:
cmds:
# 1. Create fake dag
- .venv/bin/python3 dev/airflow/airflow_dags_creator.py -o generated/airflow_dags_random.yml
# 2. Generate diagram from fake dag
- source .venv/bin/activate && airflow-diagrams generate -f generated/airflow_dags_random.yml -o generated/ -v --label-wrap .
# 3. Render diagram
- cd generated && ../.venv/bin/python3 random_dag_diagrams.py
create-mapping:
cmds:
# 1. Create dag with all available operators
- .venv/bin/python3 dev/airflow/airflow_dags_creator.py -o generated/airflow_dags_mapping.yml -a
# 2. Generate diagram from dag
- source .venv/bin/activate && airflow-diagrams generate -f generated/airflow_dags_mapping.yml -o generated/ --export-matches examples/mapping.yml
usage:
cmds:
# Convert --help output to carbon-now usage screenshot
- source .venv/bin/activate && airflow-diagrams generate --help | .venv/bin/python3 dev/usage/usage_generator.py