Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Add batch_process tool #1625

Merged
merged 1 commit into from
Feb 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Create product type extended field [#1605](https://github.com/open-apparel-registry/open-apparel-registry/pull/1605)
- Index custom text [#1607](https://github.com/open-apparel-registry/open-apparel-registry/pull/1607)
- Create extended field values for processing/facility type [#1616](https://github.com/open-apparel-registry/open-apparel-registry/pull/1616)
- Add batch_process tool [#1625](https://github.com/open-apparel-registry/open-apparel-registry/pull/1625)

### Changed

Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ The [Django](https://www.djangoproject.com) app runs inside a [Gunicorn](https:/

## Tools ⚒️

| Name | Description |
| ------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `postfacilitiescsv.py` | POST the rows of a CSV containing facility information to the facilities API |
| `devhealthcheck.sh` | Simulate application load balancer health checks in development |
| Name | Description |
|------------------------|--------------------------------------------------------------------------------------------------------|
| `batch_process` | Given a list id argument run parse, geocode, and match via the batch_process Django management command |
| `devhealthcheck.sh` | Simulate application load balancer health checks in development |
| `postfacilitiescsv.py` | POST the rows of a CSV containing facility information to the facilities API |
24 changes: 24 additions & 0 deletions tools/batch_process
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

set -e

if [[ -n "${OAR_DEBUG}" ]]; then
set -x
fi

function usage() {
echo -n \
"Usage: $(basename "$0") {list-id}
Run parse, geocode, and match via the batch_process Django management command
"
}

if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
if [ "${1:-}" = "--help" ]; then
usage
else
./scripts/manage batch_process --list-id "$1" --action parse \
&& ./scripts/manage batch_process --list-id "$1" --action geocode \
&& ./scripts/manage batch_process --list-id "$1" --action match
fi
fi