Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Exit with error log when COMMIT_TAG is not set properly on canary #2371

Merged
merged 1 commit into from
Sep 18, 2023
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
4 changes: 2 additions & 2 deletions yarn-project/canary/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM 278380418400.dkr.ecr.us-east-2.amazonaws.com/yarn-project-base AS builder
FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/yarn-project-base AS builder

RUN apk update && apk add --no-cache udev ttf-freefont chromium curl jq bash
ENV CHROME_BIN="/usr/bin/chromium-browser" PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"

ARG COMMIT_TAG="0.7.5"
ARG COMMIT_TAG="."

COPY . .

Expand Down
11 changes: 10 additions & 1 deletion yarn-project/end-to-end/scripts/setup_canary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ TARGET_PKGS_FILE=$2
# Check if file exists and read it into an array
if [ -f "$TARGET_PKGS_FILE" ]; then
mapfile -t TARGET_PKGS < <(cat "$TARGET_PKGS_FILE")
echo "Loaded array:"
echo "Loaded package array:"
for i in "${TARGET_PKGS[@]}"; do
echo "$i"
done
Expand All @@ -20,7 +20,16 @@ if [ -z "$COMMIT_TAG" ]; then
exit 0
fi

set +e # Temporarily disable exit on error
VERSION=$(npx semver $COMMIT_TAG)
RESULT=$? # Capture the exit status of the last command
set -e # Re-enable exit on error

if [ $RESULT -ne 0 ]; then
echo "Error when running 'npx semver' with commit tag: $COMMIT_TAG"
exit 1
fi

if [ -z "$VERSION" ]; then
echo "$COMMIT_TAG is not a semantic version."
exit 1
Expand Down