Skip to content

Commit

Permalink
Add build task for op-migrate command
Browse files Browse the repository at this point in the history
  • Loading branch information
ironbeer committed Apr 20, 2024
1 parent aa9cc44 commit 2873031
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
tags:
- 'v*'
branches:
- op-migrate

jobs:
release:
Expand Down Expand Up @@ -38,4 +40,5 @@ jobs:
with:
files: docker-bake.hcl
set: '*.platform=linux/amd64,linux/arm64'
targets: op-migrate
push: true
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,7 @@ install-geth:
go install -v github.com/ethereum/go-ethereum/cmd/geth@$(shell cat .gethrc); \
echo "Installed geth!"; true)
.PHONY: install-geth

op-migrate:
make -C ./op-chain-ops op-migrate
.PHONY: op-migrate
17 changes: 17 additions & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ variable "OP_PROPOSER_VERSION" {
default = "${GIT_VERSION}"
}

variable "OP_MIGRATE_VERSION" {
default = "${GIT_VERSION}"
}

variable "OP_CHALLENGER_VERSION" {
default = "${GIT_VERSION}"
}
Expand Down Expand Up @@ -104,6 +108,19 @@ target "op-proposer" {
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}/op-proposer:${tag}"]
}

target "op-migrate" {
dockerfile = "ops/docker/op-stack-go/Dockerfile"
context = "."
args = {
GIT_COMMIT = "${GIT_COMMIT}"
GIT_DATE = "${GIT_DATE}"
OP_MIGRATE_VERSION = "${OP_MIGRATE_VERSION}"
}
target = "op-migrate-target"
platforms = split(",", PLATFORMS)
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}/op-migrate:${tag}"]
}

target "op-challenger" {
dockerfile = "ops/docker/op-stack-go/Dockerfile"
context = "."
Expand Down
5 changes: 5 additions & 0 deletions op-chain-ops/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ fuzz:
go test -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzVersionedNonce ./crossdomain

.PHONY: check-l2 test fuzz

op-migrate:
go build -o ./bin/op-migrate ./cmd/op-migrate/main.go
go build -o ./bin/op-migrate-check ./cmd/check-migration/main.go
.PHONY: op-migrate
9 changes: 9 additions & 0 deletions ops/docker/op-stack-go/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ ARG OP_PROPOSER_VERSION=v0.0.0
RUN --mount=type=cache,target=/root/.cache/go-build cd op-proposer && make op-proposer \
GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$OP_PROPOSER_VERSION"

FROM --platform=$BUILDPLATFORM builder as op-migrate-builder
ARG OP_MIGRATE_VERSION=v0.0.0
RUN --mount=type=cache,target=/root/.cache/go-build cd op-chain-ops && make op-migrate \
GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$OP_MIGRATE_VERSION"

# Base layer for all services.
FROM --platform=$TARGETPLATFORM $TARGET_BASE_IMAGE as appbase
COPY --from=builder /etc/ssl /etc/ssl
Expand Down Expand Up @@ -128,3 +133,7 @@ FROM --platform=$TARGETPLATFORM appbase as op-proposer-target
COPY --from=op-proposer-builder /app/op-proposer/bin/op-proposer /usr/local/bin/
CMD ["op-proposer"]

FROM --platform=$TARGETPLATFORM appbase as op-migrate-target
COPY --from=op-migrate-builder /app/op-chain-ops/bin/op-migrate /usr/local/bin/
COPY --from=op-migrate-builder /app/op-chain-ops/bin/op-migrate-check /usr/local/bin/
CMD ["bash"]

0 comments on commit 2873031

Please sign in to comment.