-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow to import / restore from Strapi export data
- Loading branch information
Showing
1 changed file
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Import / restore from Strapi export data: | ||
// zgrep -a '"type":"api::person.person"' conf/strapi-export.tar.gz > conf/output/rppd-export-restore.jsonl | ||
// sbt "runMain rpb.ETL conf/rppd-import-from-strapi.flux IN_FILE=rppd-export-restore.jsonl HOST=$HOST API_TOKEN=$API_TOKEN" | ||
|
||
default HOST = "localhost"; // pass e.g. HOST=test-metadaten-nrw.hbz-nrw.de | ||
default IN_FILE = "rppd-export.jsonl"; // pass e.g. IN_FILE=rppd-export-restore.jsonl | ||
default API_TOKEN = ""; // pass e.g. API_TOKEN=e8d... | ||
API_URL = "http://" + HOST + ":1337/api/persons"; | ||
|
||
FLUX_DIR + "output/" + IN_FILE | ||
| open-file | ||
| as-lines | ||
| log-object("Will POST: ") | ||
| open-http(url=API_URL, method="POST", contentType="application/json", header="Authorization: Bearer " + API_TOKEN) | ||
| as-lines | ||
| log-object("POST Response: ") | ||
; |