build: target for docker building
continuous-integration/drone/push Build is failing Details

Adapted from #384.

Thanks @cas.
This commit is contained in:
decentral1se 2023-11-27 11:15:59 +01:00
parent b1d3fcbb0b
commit 31e0ed75b0
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410
2 changed files with 19 additions and 0 deletions

View File

@ -2,6 +2,7 @@ ABRA := ./cmd/abra
KADABRA := ./cmd/kadabra
COMMIT := $(shell git rev-list -1 HEAD)
GOPATH := $(shell go env GOPATH)
GOVERSION := 1.21
LDFLAGS := "-X 'main.Commit=$(COMMIT)'"
DIST_LDFLAGS := $(LDFLAGS)" -s -w"
@ -30,6 +31,13 @@ build-kadabra:
build: build-abra build-kadabra
build-docker-abra:
@docker run -it \
-v $(PWD):/abra golang:$(GOVERSION) \
bash -c 'cd /abra; mv scripts/docker/build.sh .; ./build.sh'
build-docker: build-docker-abra
clean:
@rm '$(GOPATH)/bin/abra'
@rm '$(GOPATH)/bin/kadabra'

11
build.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
if [ ! -f .envrc ]; then
. .envrc.sample
else
. .envrc
fi
git config --global --add safe.directory /abra # work around funky file permissions
make build