-
Notifications
You must be signed in to change notification settings - Fork 0
/
.build
executable file
·19 lines (14 loc) · 879 Bytes
/
.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
# https://github.com/golang/go/issues/13470
# https://github.com/GoogleCloudPlatform/google-cloud-go/issues/229
# https://github.com/tamird/cockroach/commit/9c93044ce7d3283e78f5941b8b9bcd836f80a7ef
# +LDFLAGS += -extldflags "-static-libgcc -static-libstdc++"
# GOOS=linux go build -a --ldflags '-extldflags "-static"' -tags netgo -installsuffix netgo .
version=$(git describe --tags | tr -d '\n')
pubver=$(git rev-parse --short HEAD)
echo "Making binaries version: $version versionpublic: $pubver"
# wtf, this should fix above? but didn't?
# GOOS=linux go build -a --ldflags '-extldflags "-static-libgcc -static-libstdc++"' -tags netgo -installsuffix netgo .
go clean
GOOS=linux GOARCH=amd64 go build -ldflags "-X github.com/dataux/dataux/version.Version=${version} -X github.com/dataux/dataux/version.VersionPublic=${pubver}"
echo "Finished Binary $version"