@@ -8,6 +8,8 @@ prod-run:
88docker-neo4j-rm :
99 docker stop cre-neo4j
1010 docker rm -f cre-neo4j
11+ docker volume inspect cre_neo4j_data > /dev/null 2>&1 || docker volume create cre_neo4j_data
12+ docker volume inspect cre_neo4j_logs > /dev/null 2>&1 || docker volume create cre_neo4j_logs
1113 docker volume rm cre_neo4j_data
1214 docker volume rm cre_neo4j_logs
1315 # rm -rf .neo4j
@@ -23,6 +25,10 @@ docker-redis:
2325 docker start cre-redis-stack 2> /dev/null || \
2426 docker run -d --name cre-redis-stack -p 6379:6379 -p 8001:8001 redis/redis-stack:latest
2527
28+ docker-postgres :
29+ docker start cre-postgres 2> /dev/null || \
30+ docker run -d --name cre-postgres -e POSTGRES_PASSWORD=password -e POSTGRES_USER=cre -e POSTGRES_DB=cre -p 5432:5432 postgres
31+
2632start-containers : docker-neo4j docker-redis
2733
2834start-worker :
5561test :
5662 [ -d " ./venv" ] && . ./venv/bin/activate && \
5763 export FLASK_APP=" $( CURDIR) /cre.py" && \
58- flask routes && flask test
64+ flask routes && python -m unittest discover -s application/tests -p " *_test.py "
5965
6066cover :
6167 . ./venv/bin/activate && FLASK_APP=cre.py FLASK_CONFIG=testing flask test --cover
@@ -127,7 +133,35 @@ import-neo4j:
127133 [ -d " ./venv" ] && . ./venv/bin/activate && \
128134 export FLASK_APP=" $( CURDIR) /cre.py" && python cre.py --populate_neo4j_db
129135
130- preload-map-analysis :
131- $(shell RUN_COUNT=5 bash ./scripts/preload_gap_analysis.sh)
136+ backfill-gap-analysis :
137+ RUN_COUNT=8 bash ./scripts/backfill_gap_analysis.sh
138+
139+ sync-gap-analysis-table-local :
140+ [ -d " ./venv" ] && . ./venv/bin/activate && \
141+ python scripts/sync_gap_analysis_table.py \
142+ --from-sqlite " $( CURDIR) /standards_cache.sqlite" \
143+ --to-postgres " postgresql://cre:password@127.0.0.1:5432/cre" \
144+ --require-local-destination
145+
146+ verify-ga-complete-prod :
147+ [ -d " ./venv" ] && . ./venv/bin/activate && \
148+ python scripts/verify_ga_completeness.py \
149+ --base-url " https://opencre.org" \
150+ --output-json " $( CURDIR) /tmp/prod-ga-completeness.json"
151+
152+ verify-ga-parity-local :
153+ @[ -d " ./.venv" ] && . ./.venv/bin/activate || ([ -d " ./venv" ] && . ./venv/bin/activate); \
154+ export CRE_CACHE_FILE=" $$ {CRE_CACHE_FILE:-postgresql://cre:password@127.0.0.1:5432/cre}" ; \
155+ export NEO4J_URL=" $$ {NEO4J_URL:-bolt://neo4j:password@127.0.0.1:7687}" ; \
156+ export PYTHONPATH=" $( CURDIR) " ; \
157+ python scripts/verify_ga_postgres_neo_parity.py --output-json " $( CURDIR) /tmp/local-ga-parity.json"
158+
159+ backfill-gap-analysis-sync :
160+ @[ -d " ./.venv" ] && . ./.venv/bin/activate || ([ -d " ./venv" ] && . ./venv/bin/activate); \
161+ export FLASK_APP=" $( CURDIR) /cre.py" ; \
162+ export CRE_CACHE_FILE=" $$ {CRE_CACHE_FILE:-postgresql://cre:password@127.0.0.1:5432/cre}" ; \
163+ export NEO4J_URL=" $$ {NEO4J_URL:-bolt://neo4j:password@127.0.0.1:7687}" ; \
164+ python cre.py --cache_file " $$ CRE_CACHE_FILE" --populate_neo4j_db && \
165+ python cre.py --cache_file " $$ CRE_CACHE_FILE" --ga_backfill_missing --ga_backfill_no_queue
132166
133167all : clean lint test dev dev-run
0 commit comments