Skip to content
Closed
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
29 changes: 12 additions & 17 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ install-tools-maxperf:
clean:
cargo clean

build-docker suffix="" git_sha="" git_timestamp="":
build-docker suffix="":
#!/usr/bin/env bash
set -e
# Only clean .cargo in production mode, preserve it for dev builds
Expand All @@ -312,14 +312,14 @@ build-docker suffix="" git_sha="" git_timestamp="":
TAG="op-reth:$GITHASH$SUFFIX"
echo "🐳 Building XLayer Reth Docker image: $TAG ..."

# Build with optional git info for version metadata
BUILD_ARGS=""
if [ -n "{{git_sha}}" ]; then
BUILD_ARGS="--build-arg VERGEN_GIT_SHA={{git_sha}}"
echo "📋 Using git SHA: {{git_sha}}"
fi
if [ -n "{{git_timestamp}}" ]; then
BUILD_ARGS="$BUILD_ARGS --build-arg VERGEN_GIT_COMMIT_TIMESTAMP={{git_timestamp}}"
# Use current branch's git info for version metadata
GIT_SHA=$(git rev-parse HEAD 2>/dev/null || echo "unknown")
GIT_TIMESTAMP=$(git log -1 --format=%cI 2>/dev/null || echo "")
echo "📋 Using commit SHA: $GIT_SHA"

BUILD_ARGS="--build-arg VERGEN_GIT_SHA=$GIT_SHA"
if [ -n "$GIT_TIMESTAMP" ]; then
BUILD_ARGS="$BUILD_ARGS --build-arg VERGEN_GIT_COMMIT_TIMESTAMP=$GIT_TIMESTAMP"
fi

docker build $BUILD_ARGS -t $TAG -f DockerfileOp .
Expand Down Expand Up @@ -354,19 +354,14 @@ build-docker-dev reth_path="":
rsync -au --delete --exclude='.git' --exclude='target' "$RETH_SRC/" .cargo/reth/
echo "✅ Sync complete"

# Extract git info from local reth for version metadata
RETH_GIT_SHA=$(cd "$RETH_SRC" && git rev-parse HEAD 2>/dev/null || echo "unknown")
RETH_GIT_TIMESTAMP=$(cd "$RETH_SRC" && git log -1 --format=%cI 2>/dev/null || echo "")
echo "📋 Local reth commit: $RETH_GIT_SHA"

# Generate config with /reth path (Docker will move .cargo/reth to /reth to avoid nesting)
sed "s|RETH_PATH_PLACEHOLDER|/reth|g" .reth-dev.toml > .cargo/config.toml

# Build Docker image with reth git info
just build-docker dev "$RETH_GIT_SHA" "$RETH_GIT_TIMESTAMP"
# Build Docker image (will use current branch's git info)
just build-docker dev

# Clean up synced reth source (will be re-synced on next build)
rm -rf .cargo/reth
rm -rfv .cargo/reth
echo "🧹 Cleaned up .cargo/reth"

# Restore local config for development (point to actual local path, not /reth)
Expand Down