-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTaskfile.yaml
157 lines (129 loc) · 4.7 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
version: '3'
silent: true
vars:
tag:
desc: The tag of the docker image to be built.
sh: echo "latest"
tasks:
install-backend:
desc: Install poetry and dependencies for the backend server.
cmds:
- pip3 show poetry --quiet || pip3 install poetry
- cd applications/backend && poetry install
run-db:
desc: Run a postgresql server.
cmds:
- docker run -e POSTGRES_DB=folio-feed -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 -v pg_data:/var/lib/postgresql/data postgres
- cd applications/backend/django_server && poetry run python manage.py migrate
run-rabbitmq:
desc: Run a rabbitmq server.
cmds:
- docker run -d --name rabbitmq-management -p 5672:5672 -p 15672:15672 rabbitmq:management
run-backend:
desc: Run a debug backend server (Not used in production server).
deps:
- install-backend
cmds:
- cd applications/backend/django_server && poetry run python manage.py runserver
build-backend-image:
desc: Build a backend server docker image.
cmd: cd applications/backend && docker build -t us-central1-docker.pkg.dev/folio-feed-403709/image-registry/folio-feed-backend:{{.tag}} .
push-backend-image:
desc: Push a backend server docker image to the image registry.
cmd: docker push us-central1-docker.pkg.dev/folio-feed-403709/image-registry/folio-feed-backend:{{.tag}}
install-fetcher:
desc: Install poetry and dependencies for the Data Fetcher.
cmds:
- pip3 show poetry --quiet || pip3 install poetry
- cd applications/data_fetcher && poetry install
run-fetcher:
desc: Run the Data Fetcher.
deps:
- install-fetcher
cmds:
- cd applications/data_fetcher && poetry run python fetcher.py
build-fetcher-image:
desc: Build a Data Fetcher docker image.
cmd: cd applications/data_fetcher && docker build -t us-central1-docker.pkg.dev/folio-feed-403709/image-registry/folio-feed-fetcher:{{.tag}} .
push-fetcher-image:
desc: Push a Data Fetcher docker image to the image registry.
cmd: docker push us-central1-docker.pkg.dev/folio-feed-403709/image-registry/folio-feed-fetcher:{{.tag}}
install-analyzer:
desc: Install poetry and dependencies for the Data Analyzer.
cmds:
- pip3 show poetry --quiet || pip3 install poetry
- cd applications/data_analyzer && poetry install
run-analyzer:
desc: Run the Data Analyzer.
deps:
- install-analyzer
cmds:
- cd applications/data_analyzer && poetry run python analyzer.py
build-analyzer-image:
desc: Build a Data Analyzer docker image.
cmd: cd applications/data_analyzer && docker build -t us-central1-docker.pkg.dev/folio-feed-403709/image-registry/folio-feed-analyzer:{{.tag}} .
push-analyzer-image:
desc: Push a Data Analyzer docker image to the image registry.
cmd: docker push us-central1-docker.pkg.dev/folio-feed-403709/image-registry/folio-feed-analyzer:{{.tag}}
install-lint:
desc: Install isort, black and mypy.
cmds:
- pip3 show black --quiet || pip3 install black==23.10.1
- pip3 show isort --quiet|| pip3 install isort==5.12.0
- pip3 show mypy --quiet || pip3 install mypy==1.6.1 types-requests==2.31.0.10
lint-check:
desc: Run isort, black and mypy on all files but only check.
deps:
- install-lint
cmds:
- isort --check .
- black --check .
- mypy --config-file tox.ini .
lint:
desc: Run isort, black and mypy on all files.
deps:
- install-lint
cmds:
- isort .
- black .
test-backend:
desc: Run tests for the backend server.
deps:
- install-backend
cmds:
# - cd applications/backend && poetry run pytest
- cd applications/backend/django_server && poetry run python manage.py test
test-fetcher:
desc: Run tests for the Data Fetcher.
deps:
- install-fetcher
cmds:
- pytest applications/data_fetcher
test-analyzer:
desc: Run tests for the Data Analyzer.
deps:
- install-analyzer
cmds:
- echo "Tested the Data Analyzer"
test:
desc: Run all tests.
deps:
- test-backend
- test-fetcher
- test-analyzer
# Infrastructure tasks
helm-setup:
desc: Setup helm.
cmds:
- helm repo add bitnami https://charts.bitnami.com/bitnami
- cd infrastructure/k8s/folio-feed-helm && helm dependency build
helm-upgrade:
desc: Upgrade the helm chart.
deps:
- helm-setup
cmds:
- cd infrastructure/k8s/folio-feed-helm && helm upgrade --install folio-feed -f values.yaml --namespace folio-feed . --debug
terraform-deploy:
desc: Apply the terraform configuration.
cmds:
- cd infrastructure/terraform && terraform apply -auto-approve