Skip to content

Commit

Permalink
fix: build script exiting on failed grep (#2384)
Browse files Browse the repository at this point in the history
`build` script was failing when trying to `grep` any images on
dockerfiles that were not "ours".

# Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [ ] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [ ] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).
  • Loading branch information
spypsy authored Sep 19, 2023
1 parent 41ef378 commit e70a781
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 5 additions & 2 deletions build-system/scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@ if [[ $FORCE_BUILD == 'false' ]] && check_rebuild cache-"$CONTENT_HASH" $REPOSIT
exit 0
fi

echo "Initializing submodules..."
init_submodules $REPOSITORY

echo "Checking for terraform..."
# Validate any terraform if it exists.
if [ -d $ROOT_PATH/$PROJECT_DIR/terraform ]; then
ensure_terraform
Expand All @@ -103,7 +105,7 @@ if [ -d $ROOT_PATH/$PROJECT_DIR/terraform ]; then
fi

# Pull latest parents that are not ours. We also do not want to pull images suffixed by _, this is how we scope intermediate build images.
PARENTS=$(cat $DOCKERFILE | sed -n -e 's/^FROM \([^[:space:]]\+\).*/\1/p' | sed '/_$/d' | grep -v $ECR_DEPLOY_URL | sort | uniq)
PARENTS=$(cat $DOCKERFILE | sed -n -e 's/^FROM \([^[:space:]]\+\).*/\1/p' | sed '/_$/d' | { grep -v $ECR_DEPLOY_URL || true; } | sort | uniq)
for PARENT in $PARENTS; do
[ "$PARENT" == "scratch" ] && continue
fetch_image $PARENT
Expand All @@ -128,7 +130,8 @@ for PARENT in $PARENTS; do
retry docker tag $PARENT_IMAGE_URI $TAG
done

COMMIT_TAG_VERSION=$(extract_tag_version $REPOSITORY false)
echo "Extracting commit tag version..."
COMMIT_TAG_VERSION=$(extract_tag_version $REPOSITORY "false")

# Pull, build and push each named stage to cache.
STAGE_CACHE_FROM=""
Expand Down
4 changes: 4 additions & 0 deletions yarn-project/canary/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ WORKDIR /usr/src/yarn-project/canary
RUN ./scripts/update_packages.sh $COMMIT_TAG
RUN yarn && yarn build

FROM node:18-alpine
COPY --from=builder /usr/src/ /usr/src/
WORKDIR /usr/src/yarn-project/canary

# Copy web artifacts for browser test
RUN cp ./node_modules/@aztec/aztec.js/dest/main.js src/web/
RUN cp ./node_modules/@aztec/circuits.js/resources/aztec3-circuits.wasm src/web/
Expand Down

0 comments on commit e70a781

Please sign in to comment.