Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/staging_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
# Uses Google Cloud Secret Manager to store secret credentials
- name: Create app.yaml
run: |
echo "service: nmsamplelocations" > app.yaml
echo "service: ocotillo-api" > app.yaml
echo "runtime: python313" >> app.yaml
echo "entrypoint: gunicorn -w 4 -k uvicorn.workers.UvicornWorker main:app" >> app.yaml
echo "instance_class: F4" >> app.yaml
Expand All @@ -63,10 +63,12 @@ jobs:
# Clean up old versions - delete only the oldest version, one created and one destroyed
- name: Clean up oldest version
run: |
OLDEST_VERSION=$(gcloud app versions list --service=nmsamplelocations --project=${{ secrets.GCP_PROJECT_ID }} --format="value(id)" --sort-by="version.createTime" | head -n 1)
OLDEST_VERSION=$(gcloud app versions list --service=ocotillo-api --project=${{ secrets.GCP_PROJECT_ID }}
--format="value(id)" --sort-by="version.createTime" | head -n 1)
if [ ! -z "$OLDEST_VERSION" ]; then
echo "Deleting oldest version: $OLDEST_VERSION"
gcloud app versions delete $OLDEST_VERSION --service=nmsamplelocations --project=${{ secrets.GCP_PROJECT_ID }} --quiet
gcloud app versions delete $OLDEST_VERSION --service=ocotillo-api --project=${{ secrets.GCP_PROJECT_ID }}
--quiet
echo "Deleted oldest version: $OLDEST_VERSION"
else
echo "No versions to delete"
Expand Down
3 changes: 2 additions & 1 deletion api/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ async def list_assets(

def transformer(records: list[Asset]):
if thing_id is not None:
records = [add_signed_url(ai, get_storage_bucket()) for ai in records]
bucket = get_storage_bucket()
records = [add_signed_url(ai, bucket) for ai in records]

return records

Expand Down
Loading