dbt's manifest compiled at start-up for the deployment's engine; the image carries the dbt environments
This commit is contained in:
+12
-2
@@ -16,14 +16,24 @@ for url in "$CACU_DATABASE_URL" "$CAMA_DATABASE_URL" "$TEA_DATABASE_URL" "$GOVER
|
||||
esac
|
||||
done
|
||||
|
||||
cd /app/WebApi
|
||||
|
||||
# dbt's manifest for the deployment's engine: the image's is SQLite's; on
|
||||
# another engine it's compiled now, against the configured databases, into
|
||||
# /data (webapi.dbt_manifest prints the path to use, or nothing to keep the
|
||||
# image's).
|
||||
if compiled="$(uv run --no-sync python -m webapi.dbt_manifest)"; then
|
||||
[ -n "$compiled" ] && export DBT_MANIFEST="$compiled"
|
||||
else
|
||||
echo "dbt manifest: compilation failed; the measure routes will stay unregistered" >&2
|
||||
fi
|
||||
|
||||
# The live indicator worker (webapi.recomputation) shares the image; the
|
||||
# API container runs the migrations, so the worker starts after it.
|
||||
if [ "$1" = "indicadores" ]; then
|
||||
cd /app/WebApi
|
||||
exec uv run --no-sync python -m webapi.recomputation
|
||||
fi
|
||||
|
||||
cd /app/WebApi
|
||||
# --no-sync: the environment was synced at build time; syncing at startup
|
||||
# would try to reach the package index (and pull dev deps).
|
||||
for domain in cacu cama tea governance; do
|
||||
|
||||
Reference in New Issue
Block a user