-
Notifications
You must be signed in to change notification settings - Fork 499
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4978 from jacekn/build
services/horizon add horizon binary building Makefile
- Loading branch information
Showing
2 changed files
with
21 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
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,18 @@ | ||
SUDO := $(shell docker version >/dev/null 2>&1 || echo "sudo") | ||
|
||
ifndef VERSION_STRING | ||
$(error VERSION_STRING environment variable must be set. For example "2.26.0-d2d01d39759f2f315f4af59e4b95700a4def44eb") | ||
endif | ||
|
||
DOCKER_PLATFORM := $(shell docker system info --format '{{.OSType}}/{{.Architecture}}') | ||
|
||
binary-build: | ||
$(SUDO) docker run --platform $(DOCKER_PLATFORM) --rm $(DOCKER_OPTS) -v $(shell pwd)/../../:/go/src/github.com/stellar/go \ | ||
--pull always \ | ||
--env CGO_ENABLED=0 \ | ||
--env GOFLAGS="-ldflags=-X=github.com/stellar/go/support/app.version=$(VERSION_STRING)" \ | ||
golang:1.20-bullseye \ | ||
/bin/bash -c '\ | ||
git config --global --add safe.directory /go/src/github.com/stellar/go && \ | ||
cd /go/src/github.com/stellar/go && \ | ||
go build -o stellar-horizon -trimpath -v ./services/horizon' |