Skip to content

Commit

Permalink
Start updating ci for apiv2
Browse files Browse the repository at this point in the history
  • Loading branch information
jgadling committed Oct 1, 2024
1 parent 7c6b1da commit 8ad5563
Show file tree
Hide file tree
Showing 37 changed files with 41 additions and 3,248 deletions.
31 changes: 26 additions & 5 deletions client/python/cryoet_data_portal/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,32 @@
SHELL := /bin/bash

export BACKEND_DIR=/tmp/cryoet-data-portal-backend-test-infra
.PHONY: set-api-version
set-api-version:
if [ ! -e $(BACKEND_DIR) ]; then git clone [email protected]:chanzuckerberg/cryoet-data-portal-backend.git $(BACKEND_DIR); fi
export STAGING_SHA=$$(python3 tests/test_infra/get_deployment.sh staging); \
if [ -z $STAGING_SHA ]; then \
echo "Setting backend to SHA: $${STAGING_SHA}"; \
cd $(BACKEND_DIR); \
git fetch; \
git reset --hard $$STAGING_SHA; \
else \
echo "Could not get staging SHA!"; \
exit 1; \
fi
cd $(BACKEND_DIR) && make apiv2-init

.PHONY: test-infra
test-infra:
# Use force-recreate to handle re-initializing the database schema and data
# rather than maintaining incremental migrations.
# See the test_infra/hasura/README.md for more details.
cd tests && docker compose up -d --wait --wait-timeout 300 --force-recreate
test-infra: set-api-version
cp tests/test_infra/seed_db.py $(BACKEND_DIR)/apiv2/scripts
cd $(BACKEND_DIR) && docker compose run graphql-api python3 scripts/seed_db.py
cd ./tests/test_infra/; ./seed_moto.sh

.PHONY: clean
clean:
if [ -e $(BACKEND_DIR) ]; then cd $(BACKEND_DIR); make clean; fi
rm -rf $(BACKEND_DIR)

.PHONY: coverage
coverage:
export AWS_REGION=us-west-2; \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
if [ $1 == 'staging' ]; then
# If there's a release-please branch, this is the file that controls staging versions!
RELEASE_SHA=$(curl -s "https://raw.githubusercontent.com/chanzuckerberg/cryoet-data-portal-backend/refs/heads/release-please--branches--main--components--apiv2/.infra/staging/values.yaml" | grep ' tag:' | head -n 1 | awk '{ print $2; }' | cut -d '-' -f 2)
fi
if [ -n "$RELEASE_SHA" ]; then
echo $RELEASE_SHA
else
# If this isn't staging, or we don't have an active release-please branch, fetch the appropriate hash from the `main` branch.
curl -s "https://raw.githubusercontent.com/chanzuckerberg/cryoet-data-portal-backend/refs/heads/main/.infra/$1/values.yaml" | grep ' tag:' | head -n 1 | awk '{ print $2; }' | cut -d '-' -f 2
fi
35 changes: 0 additions & 35 deletions client/python/cryoet_data_portal/tests/test_infra/hasura/README.md

This file was deleted.

Empty file.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 8ad5563

Please sign in to comment.