-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add SKIP_L1_PROPOSAL flag to skip L1 transactions
- Added SKIP_L1_PROPOSAL environment variable with default value false - When SKIP_L1_PROPOSAL=true, sets OP_SUCCINCT_SKIP_L1=true - Added logging when L1 transactions are skipped Closes #258
- Loading branch information
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
# Add default parameter for skipping L1 transactions | ||
SKIP_L1_PROPOSAL=${SKIP_L1_PROPOSAL:-false} | ||
|
||
echo "--- Installing yarn dependencies" | ||
|
||
# Disable global cache so that we can cache `.yarn/cache` in buildkite | ||
yarn config set enableGlobalCache false | ||
|
||
# Check for lockfile before running yarn --immutable | ||
if [[ -f yarn.lock ]]; then | ||
echo "--- Verifying lockfile integrity" | ||
yarn --immutable || { echo "Lockfile validation failed! Ensure your lockfile is up to date."; exit 1; } | ||
else | ||
echo "Error: yarn.lock file not found. Aborting." | ||
exit 1 | ||
fi | ||
|
||
# Need to ensure base branch is up-to-date | ||
BASE_BRANCH="${BUILDKITE_PULL_REQUEST_BASE_BRANCH:-$BUILDKITE_BRANCH}" | ||
if [[ -z "$BASE_BRANCH" ]]; then | ||
echo "Error: Unable to determine base branch. Ensure BUILDKITE_BRANCH is set." | ||
exit 1 | ||
fi | ||
|
||
echo "--- Updating local '$BASE_BRANCH' base branch" | ||
|
||
# Required for correct Nx affected project resolution | ||
if git fetch -f --no-tags origin "$BASE_BRANCH:$BASE_BRANCH"; then | ||
echo "--- Successfully updated '$BASE_BRANCH'" | ||
else | ||
echo "Error: Failed to fetch base branch '$BASE_BRANCH'. Ensure it exists in the remote repository." | ||
exit 1 | ||
fi | ||
|
||
# Check SKIP_L1_PROPOSAL flag | ||
if [ "$SKIP_L1_PROPOSAL" = true ]; then | ||
echo "--- Skipping L1 transaction step (SKIP_L1_PROPOSAL=true)" | ||
export OP_SUCCINCT_SKIP_L1=true | ||
fi | ||
|
||
echo "--- Building required packages" | ||
if yarn build; then | ||
echo "--- Build completed successfully" | ||
else | ||
echo "Error: Build failed. Check the logs for details." | ||
exit 1 | ||
fi |