Skip to content

Commit

Permalink
person test dates to integers
Browse files Browse the repository at this point in the history
  • Loading branch information
emgeier authored Nov 13, 2024
1 parent 6343ae8 commit 04ce3a9
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jobs:
# Extract the filename and create the index header for OpenSearch bulk format
filename=$(basename ${file%.xml})
echo "Processing $filename for JSON"
printf "{\"index\":{\"_index\":\"syriaca-index-2\",\"_id\":\"$type-$filename\"}}\n" >> bulk_data.json
printf "{\"index\":{\"_index\":\"syriaca-index-3\",\"_id\":\"$type-$filename\"}}\n" >> bulk_data.json

# Apply XSLT for JSON conversion and append it to bulk_data.json directly
java -jar saxon.jar -s:$file -xsl:json-stylesheet.xsl docType="$type" | tr -d '\n' >> bulk_data.json
Expand Down Expand Up @@ -167,7 +167,7 @@ jobs:
# Step 7: Upload files to S3
- name: Upload JSON file to S3
run: |
aws s3 cp bulk_data.json s3://srophe-syriaca-front-end/json-data/advancedsearchfields/bulk_data_persons_spacing_title.json
aws s3 cp bulk_data.json s3://srophe-syriaca-front-end/json-data/advancedsearchfields/bulk_data_persons_spacing_dates.json
env:
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
Expand Down Expand Up @@ -195,23 +195,23 @@ jobs:

# Step 8: Upload JSON data to OpenSearch

- name: JSON file to OpenSearch
# - name: JSON file to OpenSearch

env:
OPENSEARCH_URL: ${{ secrets.OPENSEARCH_URL }}
OPENSEARCH_USER: ${{ secrets.OPENSEARCH_USER }}
OPENSEARCH_PASSWORD: ${{ secrets.OPENSEARCH_PASSWORD }}
run: |
RESPONSE=$(curl -s -o response.json -w "%{http_code}" -XPOST "$OPENSEARCH_URL/_bulk" \
-H "Content-Type: application/json" \
-u "$OPENSEARCH_USER:$OPENSEARCH_PASSWORD" \
--data-binary "@bulk_data.json")
echo "HTTP response code: $RESPONSE"
cat response.json
# Check for errors in the response
if grep -q '"errors":true' response.json; then
echo "Errors occurred during bulk upload"
exit 1
fi
# env:
# OPENSEARCH_URL: ${{ secrets.OPENSEARCH_URL }}
# OPENSEARCH_USER: ${{ secrets.OPENSEARCH_USER }}
# OPENSEARCH_PASSWORD: ${{ secrets.OPENSEARCH_PASSWORD }}
# run: |
# RESPONSE=$(curl -s -o response.json -w "%{http_code}" -XPOST "$OPENSEARCH_URL/_bulk" \
# -H "Content-Type: application/json" \
# -u "$OPENSEARCH_USER:$OPENSEARCH_PASSWORD" \
# --data-binary "@bulk_data.json")
# echo "HTTP response code: $RESPONSE"
# cat response.json

# # Check for errors in the response
# if grep -q '"errors":true' response.json; then
# echo "Errors occurred during bulk upload"
# exit 1
# fi

0 comments on commit 04ce3a9

Please sign in to comment.