From 161ea314b9fa547cbbedf4599e94775f79a7f4a6 Mon Sep 17 00:00:00 2001 From: Sepideh Alassi Date: Tue, 11 May 2021 17:25:41 +0200 Subject: [PATCH] feat(conf): Rule to dump prod data and load locally (DSP-1485) (#1857) * feat(conf): add make rule for dump of prod data and load to local instance of triplestore * refactor (conf): clean up --- Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Makefile b/Makefile index 685147d89c..fd495a7c80 100644 --- a/Makefile +++ b/Makefile @@ -289,16 +289,28 @@ 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 staging data db_staging_dump.trig: @echo $@ @curl -X GET -H "Accept: application/trig" -u "admin:${DB_STAGING_PASSWORD}" "https://db.staging.dasch.swiss/dsp-repo" > "db_staging_dump.trig" +## Dump production data +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-staging init-db-test-from-staging: db_staging_dump.trig init-db-test-empty ## init local database with data from staging @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_staging_dump.trig" -u "admin:test" "http://localhost:3030/knora-test" +.PHONY: init-db-test-from-prod +init-db-test-from-prod: db_prod_dump.trig init-db-test-empty ## init local database with data from production + @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_prod_dump.trig" -u "admin:test" "http://localhost:3030/knora-test" + .PHONY: metadata metadata: metadata-standard metadata-minimal metadata-maximal ## add three example metadata sets