Skip to content

Commit

Permalink
chore(init-db): init db test data from test server (DEV-198) (#1936)
Browse files Browse the repository at this point in the history
  • Loading branch information
kilchenmann committed Nov 9, 2021
1 parent 3c2865c commit 1c24bea
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions Makefile
Expand Up @@ -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 $@
Expand All @@ -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 $@
Expand Down

0 comments on commit 1c24bea

Please sign in to comment.