From c7fff62b3f385c0784fdfab3c06a50865796c8d0 Mon Sep 17 00:00:00 2001 From: Maddiaa0 <47148561+Maddiaa0@users.noreply.github.com> Date: Wed, 25 Oct 2023 21:02:38 +0000 Subject: [PATCH] fix: independent repos --- yarn-project/boxes/run_tests | 38 ++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/yarn-project/boxes/run_tests b/yarn-project/boxes/run_tests index 6fc24364a0fd..c1b3bce05dfb 100755 --- a/yarn-project/boxes/run_tests +++ b/yarn-project/boxes/run_tests @@ -9,31 +9,43 @@ BOX_NAME=${1:-boxes-blank} cd $CURRENT_DIR/$BOX_NAME -export COMPOSE_FILE=${1:-docker-compose.yml} +export COMPOSE_FILE=${2:-docker-compose.yml} ecr_login -REPO=aztec-sandbox +SANDBOX=aztec-sandbox +YARN_PROJECT=yarn-project -ensure_repo $REPO $ECR_REGION refresh_lifecycle -CONTENT_HASH=$(calculate_content_hash $REPO) -BASE_TAG=cache-$CONTENT_HASH +SANDBOX_IMAGE_URI=$(calculate_image_uri $SANDBOX) +YP_IMAGE_URI=$(calculate_image_uri $YARN_PROJECT) + +ensure_repo $SANDBOX $ECR_REGION refresh_lifecycle +CONTENT_HASH=$(calculate_content_hash $SANDBOX) +BASE_TAG=cache-$CONTENT_HASH-$BOX_NAME # Append the box name to seperate the tag SUCCESS_TAG=$BASE_TAG echo "Content hash: $CONTENT_HASH" -if check_rebuild $SUCCESS_TAG $REPO; then +if check_rebuild $SUCCESS_TAG $SANDBOX; then echo "No rebuild required." + retry tag_remote_image $SANDBOX $BASE_TAG $SUCCESS_TAG exit 0 fi -echo "pulling docker image for $REPO $(calculate_image_uri $REPO)-x86_64" -retry docker pull $(calculate_image_uri $REPO)-x86_64 -retry docker tag $(calculate_image_uri $REPO)-x86_64 aztecprotocol/$REPO:latest -REPO=yarn-project -echo "pulling docker image for $REPO $(calculate_image_uri $REPO)" -retry docker pull $(calculate_image_uri $REPO) -retry docker tag $(calculate_image_uri $REPO) aztecprotocol/$REPO:latest +echo "pulling docker image for $SANDBOX $SANDBOX_IMAGE_URI-x86_64" +retry docker pull $SANDBOX_IMAGE_URI-x86_64 +retry docker tag $SANDBOX_IMAGE_URI-x86_64 aztecprotocol/$SANDBOX:latest + +echo "pulling docker image for $YARN_PROJECT $YP_IMAGE_URI" +retry docker pull $YP_IMAGE_URI +retry docker tag $YP_IMAGE_URI aztecprotocol/$YARN_PROJECT:latest docker-compose rm -f docker-compose -f $COMPOSE_FILE up --exit-code-from boxes-$BOX_NAME + + + +# Success - push a new tag for the commit hash. +IMAGE_COMMIT_URI=$SANDBOX_IMAGE_URI-$BOX_NAME +retry docker tag $SANDBOX_IMAGE_URI-x86_64 $IMAGE_COMMIT_URI +retry docker push $IMAGE_COMMIT_URI > /dev/null 2>&1 \ No newline at end of file