Skip to content

Commit c6d67d8

Browse files
Added logs for the populatedb script and a docker copy command in automatic_populatedb_prod
1 parent 5c2b28f commit c6d67d8

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

scripts/automatic_populatedb_prod.sh

+2
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,5 @@ rm -f npidata_pfile.csv
5656
rm -f npidata_pfile
5757

5858
echo "$current_datetime - done" >> $log_file
59+
60+
docker cp lantern-back-end_endpoint_manager_1:/etc/lantern/populatedb_logs.txt /etc/lantern/logs/

scripts/populatedb.sh

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
#!/bin/sh
22

3+
log_file="/etc/lantern/populatedb_logs.txt"
4+
current_datetime=$(date +"%Y-%m-%d %H:%M:%S")
5+
36
set -e
47

58
# get endpoint data
69
cd cmd/endpointpopulator
710

811
# Populates the database with State Medicaid endpoints
9-
go run main.go /etc/lantern/resources/MedicaidState_EndpointSources.json Lantern StateMedicaid false StateMedicaid
12+
go run main.go /etc/lantern/resources/MedicaidState_EndpointSources.json Lantern StateMedicaid false StateMedicaid >> $log_file 2>&1
1013

1114
jq -c '.[]' /etc/lantern/resources/MedicareStateEndpointResourcesList.json | while read endpoint; do
1215
NAME=$(echo $endpoint | jq -c -r '.EndpointName')
@@ -15,7 +18,7 @@ jq -c '.[]' /etc/lantern/resources/MedicareStateEndpointResourcesList.json | whi
1518
LISTURL=$(echo $endpoint | jq -c -r '.URL')
1619

1720
if [ -f "/etc/lantern/resources/$FILENAME" ]; then
18-
go run main.go /etc/lantern/resources/$FILENAME $FORMAT "${NAME}" true $LISTURL
21+
go run main.go /etc/lantern/resources/$FILENAME $FORMAT "${NAME}" true $LISTURL >> $log_file 2>&1
1922
fi
2023
done
2124

@@ -25,7 +28,7 @@ jq -c '.[]' /etc/lantern/resources/EndpointResourcesList.json | while read endpo
2528
FILENAME=$(echo $endpoint | jq -c -r '.FileName')
2629
LISTURL=$(echo $endpoint | jq -c -r '.URL')
2730

28-
go run main.go /etc/lantern/resources/$FILENAME $FORMAT $NAME false $LISTURL
31+
go run main.go /etc/lantern/resources/$FILENAME $FORMAT $NAME false $LISTURL >> $log_file 2>&1
2932
done
3033

3134
jq -c '.[]' /etc/lantern/resources/CHPLEndpointResourcesList.json | while read endpoint; do
@@ -35,7 +38,7 @@ jq -c '.[]' /etc/lantern/resources/CHPLEndpointResourcesList.json | while read e
3538
LISTURL=$(echo $endpoint | jq -c -r '.URL')
3639

3740
if [ -f "/etc/lantern/resources/$FILENAME" ]; then
38-
go run main.go /etc/lantern/resources/$FILENAME $FORMAT "${NAME}" true $LISTURL
41+
go run main.go /etc/lantern/resources/$FILENAME $FORMAT "${NAME}" true $LISTURL >> $log_file 2>&1
3942
fi
4043
done
4144

@@ -46,7 +49,7 @@ cd ..
4649

4750
# get CHPL info into db
4851
cd chplquerier
49-
go run main.go
52+
go run main.go >> $log_file 2>&1
5053
cd ..
5154

5255
# get NPPES contact (endpoint) pfile into db
@@ -64,5 +67,5 @@ cd ..
6467

6568
# run data validation to ensure number of endpoints does not exceed maximum for query interval
6669
cd datavalidation
67-
go run main.go
70+
go run main.go >> $log_file 2>&1
6871
cd ..

0 commit comments

Comments
 (0)