Skip to content

Commit

Permalink
Add db-migration makefile target
Browse files Browse the repository at this point in the history
  • Loading branch information
hellais committed Apr 8, 2024
1 parent 377e9f2 commit 5abfc56
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ooniapi/services/oonirun/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ COPY --from=builder /build/README.md /app/
COPY --from=builder /build/dist/*.whl /app/
RUN pip install /app/*whl && rm /app/*whl

COPY --from=builder /build/alembic/ /app/alembic/
COPY --from=builder /build/src/oonirun/common/alembic/ /app/alembic/
COPY --from=builder /build/src/oonirun/common/alembic.ini /app/
RUN rm -rf /app/alembic/__pycache__

Expand Down
6 changes: 6 additions & 0 deletions ooniapi/services/oonirun/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,10 @@ clean:
run:
hatch run uvicorn $(SERVICE_NAME).main:app

db-migration: docker-build
docker run \
-e OONI_PG_URL=$(shell aws secretsmanager get-secret-value --secret-id oonidevops/ooni-tier0-postgres/postgresql_url | jq .SecretString) \
${IMAGE_NAME}:${BUILD_LABEL} \
alembic upgrade head

.PHONY: init test build clean docker print-labels

0 comments on commit 5abfc56

Please sign in to comment.