-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
66 lines (52 loc) · 2.85 KB
/
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
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
.PHONY: test dev-db test-db clean-test-db
test: clean-test-db test-db
@printf "\nRunning unittest...\n"
DATABASE_URL=postgres://postgres:password@localhost:5432/test_biomedgps cargo test
test-db: clean-test-db create-docker create-db
create-docker:
@printf "\nLaunch postgres database...(default password: password)\n"
# Make it compatible with mac and linux, the temp folder is different, so we need to mount both
@docker run -v /tmp:/tmp -v /var/folders:/var/folders --name biomedgps -e POSTGRES_PASSWORD=password -e POSTGRES_USER=postgres -p 5432:5432 -d nordata/postgresml:v2.8.3-1c11927
@sleep 3
create-db:
@echo "Create database: test_biomedgps"
@bash build/create-db.sh test_biomedgps 5432
@echo "Migrate database: test_biomedgps"
@export DATABASE_URL=postgres://postgres:password@localhost:5432/test_biomedgps && cargo run --bin biomedgps-cli -v initdb
@cp -R ./examples/ /tmp/examples/
@export DATABASE_URL=postgres://postgres:password@localhost:5432/test_biomedgps && cargo run --bin biomedgps-cli -v importdb -D -f /tmp/examples/entity.tsv -t entity
@export DATABASE_URL=postgres://postgres:password@localhost:5432/test_biomedgps && cargo run --bin biomedgps-cli -v importdb -D -f /tmp/examples/relation.tsv -t relation
@export DATABASE_URL=postgres://postgres:password@localhost:5432/test_biomedgps && cargo run --bin biomedgps-cli -v importdb -D -f /tmp/examples/entity_embedding.tsv -t entity_embedding
@export DATABASE_URL=postgres://postgres:password@localhost:5432/test_biomedgps && cargo run --bin biomedgps-cli -v importdb -D -f /tmp/examples/knowledge_curation.tsv -t knowledge_curation
clean-test-db:
@printf "Stop "
@-docker stop biomedgps
@printf "Clean "
@-docker rm biomedgps
clean-studio:
@printf "Clean studio...\n"
@cd studio && rm -rf node_modules && rm -rf dist && yarn cache clean && cd ..
build-studio:
@printf "Building studio based on openapi...\n"
@mkdir -p assets
@cd studio && yarn && yarn openapi || true
@cd studio && yarn build:embed && cd ..
build-biomedgps:
@cargo build --release
build-biomedgps-linux:
@cargo build --release --target=x86_64-unknown-linux-musl
build-mac: build-studio build-biomedgps
@printf "\nDone!\n"
build-linux: build-studio build-biomedgps
@printf "\nDone!\n"
build-linux-on-mac: build-studio build-biomedgps-linux
@printf "\nDone!\n"
# You must run `make build-service` to build new api spec for studio when you change the api spec
build-service:
@printf "Building service based on openapi...\n"
@curl -H "Accept: application/json" http://localhost:3000/spec
@cd studio && yarn && yarn openapi && cd ..
changelog:
@printf "Generate changelog...\n"
@python build/build_changelog.py --repo ../biominer-components --output-file ./studio/public/README/changelog.md --repo-name 'BioMedGPS UI'
@python build/build_changelog.py --repo . --output-file ./studio/public/README/changelog.md --repo-name BioMedGPS