Skip to content

Commit

Permalink
Merge pull request #4978 from jacekn/build
Browse files Browse the repository at this point in the history
services/horizon add horizon binary building Makefile
  • Loading branch information
jacekn authored Aug 8, 2023
2 parents 62bc09d + 8ebbd9e commit f110180
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ ticker:
friendbot:
$(MAKE) -C services/friendbot/ docker-build

horizon:
$(MAKE) -C services/horizon/ binary-build

webauth:
$(MAKE) -C exp/services/webauth/ docker-build

Expand Down
18 changes: 18 additions & 0 deletions services/horizon/Makefile
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'

0 comments on commit f110180

Please sign in to comment.