-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move transform command into http service (#7)
- Loading branch information
Showing
5 changed files
with
401 additions
and
349 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 |
---|---|---|
|
@@ -2,3 +2,4 @@ fabricator | |
fabricator_pid.txt | ||
nohup.out | ||
*.csv | ||
*.zip |
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 |
---|---|---|
@@ -1,36 +1,55 @@ | ||
# fabricator | ||
|
||
Prepare a CSV to load via Islandora Workbench | ||
|
||
This is a convenience utility to allow a more user friendly spreadsheet to then be converted to the format Workbench expects. Can be thought of as middleware between normal spreadsheet curation and the format workbench expects. | ||
Transform a Google Sheet URL into a fully executed [Islandora Workbench](https://github.com/mjordan/islandora_workbench) task. | ||
|
||
## Overview | ||
|
||
- Content creators can work in Google Sheets to prepare a spreadsheet | ||
- [A Google Appscript](./google/appsscript) is embeded in the sheet to allow easily checking their work | ||
- When the spreadsheet is ready, it can be ingested into Islandora/Drupal via Islandora Workbench by supplying the sheet URL in [the GitHub Action](./.github/workflows/run.yml) | ||
|
||
```mermaid | ||
sequenceDiagram | ||
actor Alice | ||
Alice->>Google Sheets: Edit 1 | ||
Alice->>Google Sheets: Edit 2 | ||
Alice->>Google Sheets: Edit ... | ||
Alice->>Google Sheets: Edit N | ||
Google Sheets->>Alice: <br>Download CSV | ||
Alice->>Fabricator: template.csv | ||
Fabricator->>Fabricator: processing/validating | ||
Fabricator->>Alice: workbench.csv | ||
Alice->>Islandora Workbench: workbench.csv | ||
Alice->>Google Sheets: Click check my work | ||
Google Sheets->>Fabricator: Check this CSV | ||
Fabricator->>Alice: Looks good 🚀 | ||
Alice->>GitHub: Run workbench workflow | ||
GitHub->>Self-hosted Runner: Run workbench workflow | ||
Self-hosted Runner->>Islandora Workbench: python3 workbench | ||
Islandora Workbench->>Drupal: entity CUD | ||
Islandora Workbench->>GitHub: logs | ||
Alice->>GitHub: View action logs | ||
``` | ||
|
||
## Getting started | ||
|
||
### Start the server | ||
|
||
``` | ||
go run main.go \ | ||
--source /path/to/google/sheet.csv \ | ||
--target workbench.csv | ||
export SHARED_SECRET=changeme | ||
go build | ||
nohup ./fabrictor & | ||
echo $! > pid | ||
``` | ||
|
||
### Get a workbench CSV from a google sheet CSV | ||
|
||
## TODO | ||
- [ ] HTTP service to allow a Google Sheets Apps script to validate a spreadsheet | ||
- [ ] Validator service | ||
- [ ] CSV transform service | ||
``` | ||
curl -s \ | ||
-H "X-Secret: $SHARED_SECRET" \ | ||
-XPOST \ | ||
-o target.zip \ | ||
--upload-file source.csv \ | ||
http://localhost:8080/workbench/transform | ||
``` | ||
|
||
### Stop the service | ||
|
||
``` | ||
kill $(cat pid) | ||
``` |
Oops, something went wrong.