-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
37 lines (29 loc) · 971 Bytes
/
Makefile
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
.PHONY: all clean
POSTGRES_DATA = ./postgres/sql
all: clean_database
@echo [EXECUTING] ./scripts/$(EXEC)
@bash ./scripts/exec.sh
download: clean_fetcher clean_database
@echo [CREATING] fetcher/data folder
@-mkdir ./fetcher/data
@echo [DOWNLOADING] data from the source...
@docker-compose run fetcher python ./update_data/download.py
@echo [REMOVING] data from postgres...
@-rm $(POSTGRES_DATA)/01_data.sql
@echo [MOVING] data from fetcher to sql...
@mv ./fetcher/data/* ./postgres/sql
upload:
@echo [UPLOADING] data...
@docker-compose run fetcher python ./update_data/upload.py
populate:
@-docker compose down
@-docker compose build --no-cache
@-docker volume rm tts_postgres_data || true
@-docker compose up
clean: clean_fetcher clean_database
clean_fetcher:
@echo [CLEANING] Removing folder fetcher/data...
@-rm -r ./fetcher/data
clean_database:
@echo [CLEANING] Removing database data...
@-docker volume rm tts_postgres_data || true