Skip to content

Commit

Permalink
More content hash usage
Browse files Browse the repository at this point in the history
  • Loading branch information
ludamad committed Sep 3, 2023
1 parent 1543d96 commit a1aaef3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
6 changes: 3 additions & 3 deletions yarn-project/end-to-end/scripts/cond_run_script
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ shift

CONTENT_HASH=$(calculate_content_hash $REPOSITORY)

echo "Last successful commit for $SUCCESS_TAG: $CONTENT_HASH"
echo "Content hash: $CONTENT_HASH"
echo "Script to run is $SCRIPT_TO_RUN $@"

if ! check_rebuild cache-$COMMIT_HASH-$SUCCESS_TAG $REPOSITORY; then
if ! check_rebuild cache-$CONTENT_HASH-$SUCCESS_TAG $REPOSITORY; then
"$SCRIPT_TO_RUN" "$@"
tag_remote_image $REPOSITORY cache-$COMMIT_HASH cache-$COMMIT_HASH-$SUCCESS_TAG
tag_remote_image $REPOSITORY cache-$CONTENT_HASH cache-$CONTENT_HASH-$SUCCESS_TAG
fi
15 changes: 7 additions & 8 deletions yarn-project/end-to-end/scripts/run_tests
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ set -e
export TEST=$1
export COMPOSE_FILE=${2:-docker-compose.yml}

if [ -n "$COMMIT_HASH" ]; then
$(aws ecr get-login --region us-east-2 --no-include-email) 2> /dev/null
CONTENT_HASH=$(calculate_content_hash $REPO)
$(aws ecr get-login --region us-east-2 --no-include-email) 2> /dev/null

for REPO in aztec.js end-to-end aztec-sandbox; do
docker pull 278380418400.dkr.ecr.us-east-2.amazonaws.com/$REPO:cache-$COMMIT_HASH
docker tag 278380418400.dkr.ecr.us-east-2.amazonaws.com/$REPO:cache-$COMMIT_HASH aztecprotocol/$REPO:latest
done
fi
for REPO in aztec.js end-to-end aztec-sandbox; do
docker pull 278380418400.dkr.ecr.us-east-2.amazonaws.com/$REPO:cache-$CONTENT_HASH
docker tag 278380418400.dkr.ecr.us-east-2.amazonaws.com/$REPO:cache-$CONTENT_HASH aztecprotocol/$REPO:latest
done

docker-compose rm -f
docker-compose -f $COMPOSE_FILE up --exit-code-from end-to-end
docker-compose -f $COMPOSE_FILE up --exit-code-from end-to-end

0 comments on commit a1aaef3

Please sign in to comment.