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

[Node] Add ldlflag to build #519

Merged
merged 4 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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: 4 additions & 0 deletions .github/workflows/docker-publish-opr-node-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
commit_sha:
description: 'Specific Commit SHA (Required)'
required: true
version:
description: 'Version (Required)'
required: true
release_tag:
description: 'Release Tag (Optional)'
required: false
Expand Down Expand Up @@ -64,6 +67,7 @@ jobs:
tags: ${{ env.REGISTRY }}/layr-labs/eigenda/opr-node:${{ steps.set_tag.outputs.tag }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
build-args: SEMVER=${{ github.event.inputs.version }}
if: ${{ success() }}

- name: Build and Push NodePlugin Image
Expand Down
4 changes: 3 additions & 1 deletion node/cmd/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM golang:1.21.1-alpine3.18 as builder

ARG SEMVER

RUN apk add --no-cache make musl-dev linux-headers gcc git jq bash

# build node with local monorepo go modules
Expand All @@ -16,7 +18,7 @@ COPY go.sum /app

WORKDIR /app/node

RUN go build -o ./bin/node ./cmd
RUN go build -ldflags="-X 'node.SemVer=${SEMVER}'" -o ./bin/node ./cmd

FROM alpine:3.18

Expand Down
2 changes: 1 addition & 1 deletion node/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const (
// Min number of seconds for the ExpirationPollIntervalSecFlag.
minExpirationPollIntervalSec = 3
AppName = "da-node"
SemVer = "0.6.1"
GitCommit = ""
siddimore marked this conversation as resolved.
Show resolved Hide resolved
GitDate = ""
)
Expand All @@ -35,6 +34,7 @@ var (
0: "eth_quorum",
1: "permissioned_quorum",
}
SemVer = "v0.0.0"
)

// Config contains all of the configuration information for a DA node.
Expand Down
Loading