This repository was archived by the owner on Jul 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (22 loc) · 1.32 KB
/
Copy pathMakefile
File metadata and controls
32 lines (22 loc) · 1.32 KB
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
#!make
include .env
export $(shell sed 's/=.*//' .env)
.PHONY: db migrate run
db:
docker-compose -p ${DB_CONTAINER_NAME} -f dc-db.yml down -v
docker-compose -p ${DB_CONTAINER_NAME} -f dc-db.yml up -d
migrate:
docker run --rm -v $(shell pwd)/migrations:/migrations --network host migrate/migrate -path=/migrations/ -database "mysql://${DB_USER}:${DB_PASSWORD}@tcp(${DB_IP}:${DB_PORT})/${DB_NAME}" up
migrate-to:
docker run --rm -v $(shell pwd)/migrations:/migrations --network host migrate/migrate -path=/migrations/ -database "mysql://${DB_USER}:${DB_PASSWORD}@tcp(${DB_IP}:${DB_PORT})/${DB_NAME}" goto $(MIGRATION)
validator:
cd .. && cd Curation-Validation-Bot && python3.9 -m uvicorn validator-server:app --host 127.0.0.1 --port 8371 --workers 8
archive-indexer:
cd .. && cd recursive-archive-indexer && python3.9 -m uvicorn main:app --host 127.0.0.1 --port 8372 --workers 8
dump-db:
mkdir -p ./backups/db/
docker exec ${DB_CONTAINER_NAME} /usr/bin/mysqldump -u root --password=${DB_ROOT_PASSWORD} ${DB_NAME} --compress --dump-date --verbose > ./backups/db/db-dump-${DB_NAME}-$(shell date -u +"%Y-%m-%d-%H-%M-%S").sql
restore-db:
cat $(SQL_FILE) | pv | docker exec -i ${DB_CONTAINER_NAME} /usr/bin/mysql -u root --password=${DB_ROOT_PASSWORD} ${DB_NAME}
run:
export GIT_COMMIT=$(shell git rev-list -1 HEAD) && go run ./main/*.go