Commit 2171f581 authored by Mark Tyneway's avatar Mark Tyneway

fix: op-exporter build

The build and the docker build was broken, this commit
fixes that
parent dfab86ff
...@@ -44,3 +44,4 @@ coverage.out ...@@ -44,3 +44,4 @@ coverage.out
# Ignore bedrock go bindings local output files # Ignore bedrock go bindings local output files
op-bindings/bin op-bindings/bin
op-exporter
FROM golang:1.18.0-alpine3.15 as builder FROM golang:1.18.0-alpine3.15 as builder
# build from root of repo
COPY ./op-exporter /app COPY ./op-exporter /app
WORKDIR /app/ WORKDIR /app/
RUN apk --no-cache add make bash jq git
RUN make build RUN make build
FROM alpine:3.15 FROM alpine:3.15
......
...@@ -10,9 +10,9 @@ ifndef BUILDDATE ...@@ -10,9 +10,9 @@ ifndef BUILDDATE
BUILDDATE := `date +%Y-%m-%d` BUILDDATE := `date +%Y-%m-%d`
endif endif
LDFLAGSSTRING :=-X github.com/ethereum-optimism/op_exporter/version.Version=$(VERSION) LDFLAGSSTRING :=-X github.com/ethereum-optimism/op-exporter/version.Version=$(VERSION)
LDFLAGSSTRING +=-X github.com/ethereum-optimism/op_exporter/version.GitCommit=$(GITCOMMIT) LDFLAGSSTRING +=-X github.com/ethereum-optimism/op-exporter/version.GitCommit=$(GITCOMMIT)
LDFLAGSSTRING +=-X github.com/ethereum-optimism/op_exporter/version.BuildDate=$(BUILDDATE) LDFLAGSSTRING +=-X github.com/ethereum-optimism/op-exporter/version.BuildDate=$(BUILDDATE)
LDFLAGS :=-ldflags "$(LDFLAGSSTRING)" LDFLAGS :=-ldflags "$(LDFLAGSSTRING)"
...@@ -22,4 +22,4 @@ all: build ...@@ -22,4 +22,4 @@ all: build
# Build binary # Build binary
build: build:
CGO_ENABLED=0 go build $(LDFLAGS) CGO_ENABLED=0 go build $(LDFLAGS)
\ No newline at end of file
This diff is collapsed.
...@@ -10,8 +10,9 @@ import ( ...@@ -10,8 +10,9 @@ import (
"sync" "sync"
"time" "time"
"github.com/ethereum-optimism/op_exporter/k8sClient" "github.com/ethereum-optimism/optimism/op-exporter/k8sClient"
"github.com/ethereum-optimism/op_exporter/version" "github.com/ethereum-optimism/optimism/op-exporter/version"
"github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/common/hexutil"
"github.com/prometheus/client_golang/prometheus/promhttp" "github.com/prometheus/client_golang/prometheus/promhttp"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
...@@ -76,7 +77,7 @@ func main() { ...@@ -76,7 +77,7 @@ func main() {
kingpin.Parse() kingpin.Parse()
if *versionFlag { if *versionFlag {
fmt.Printf("(version=%s, gitcommit=%s)\n", version.Version, version.GitCommit) fmt.Printf("(version=%s, gitcommit=%s)\n", version.Version, version.GitCommit)
fmt.Printf("(go=%s, user=%s, date=%s)\n", version.GoVersion, version.BuildUser, version.BuildDate) fmt.Printf("(go=%s, date=%s)\n", version.GoVersion, version.BuildDate)
os.Exit(0) os.Exit(0)
} }
log.Infoln("exporter config", *listenAddress, *rpcProvider, *networkLabel) log.Infoln("exporter config", *listenAddress, *rpcProvider, *networkLabel)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment