Skip to content
Permalink
Browse files
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
  • Loading branch information
SepidehAlassi committed May 11, 2021
1 parent 999a2bb commit 161ea314b9fa547cbbedf4599e94775f79a7f4a6
Showing with 12 additions and 0 deletions.
  1. +12 −0 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

0 comments on commit 161ea31

Please sign in to comment.