Skip to content
Permalink
Browse files
chore(init-db): init db test data from test server (DEV-198) (#1936)
  • Loading branch information
kilchenmann committed Nov 9, 2021
1 parent 3c2865c commit 1c24beaf2ce01162569c0e619bf268f4684ac753
Showing with 13 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +11 −0 Makefile
@@ -56,7 +56,9 @@ dump.rdb
/site/
dependencies.txt
/client-test-data.zip
/db_prod_dump.trig
/db_staging_dump.trig
/db_test_dump.trig
/.vscode
/cleandeps.sh
/.metals
@@ -292,6 +292,11 @@ init-db-test-unit-minimal: stack-down-delete-volumes stack-db-only ## initialize
@echo $@
@$(MAKE) -C webapi/scripts fuseki-init-knora-test-unit-minimal

## Dump test data
db_test_dump.trig:
@echo $@
@curl -X GET -H "Accept: application/trig" -u "admin:${DB_TEST_PASSWORD}" "https://db.test.dasch.swiss/dsp-repo" > "db_test_dump.trig"

## Dump staging data
db_staging_dump.trig:
@echo $@
@@ -302,6 +307,12 @@ db_prod_dump.trig:
@echo $@
@curl -X GET -H "Accept: application/trig" -u "admin:${DB_PROD_PASSWORD}" "https://db.dasch.swiss/dsp-repo" > "db_prod_dump.trig"

.PHONY: init-db-test-from-test
init-db-test-from-test: db_test_dump.trig init-db-test-empty ## init local database with data from test
@echo $@
@curl -X POST -H "Content-Type: application/sparql-update" -d "DROP ALL" -u "admin:test" "http://localhost:3030/knora-test"
@curl -X POST -H "Content-Type: application/trig" --data-binary "@${CURRENT_DIR}/db_test_dump.trig" -u "admin:test" "http://localhost:3030/knora-test"

.PHONY: init-db-test-from-staging
init-db-test-from-staging: db_staging_dump.trig init-db-test-empty ## init local database with data from staging
@echo $@

0 comments on commit 1c24bea

Please sign in to comment.