Don't use static compilation for non-release builds (it makes the CI really slow)
This commit is contained in:
parent
d45edcf08c
commit
971bef06e5
@ -3,13 +3,15 @@
|
|||||||
set -x
|
set -x
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
export CGO_ENABLED=1
|
# General build flags
|
||||||
export CC=musl-gcc
|
FLAGS="-s -w -X gitlab.com/offline-twitter/twitter_offline_engine/internal/webserver.use_embedded=true"
|
||||||
|
|
||||||
FLAGS="-s -w -linkmode=external -extldflags=-static -X gitlab.com/offline-twitter/twitter_offline_engine/internal/webserver.use_embedded=true"
|
|
||||||
|
|
||||||
if [[ -n "$1" ]]; then
|
if [[ -n "$1" ]]; then
|
||||||
go build -ldflags="$FLAGS -X main.version_string=$1" -o tw ./twitter
|
# Static build params
|
||||||
|
export CGO_ENABLED=1
|
||||||
|
export CC=musl-gcc
|
||||||
|
SPECIAL_FLAGS_FOR_STATIC_BUILD="-linkmode=external -extldflags=-static"
|
||||||
|
go build -ldflags="$FLAGS $SPECIAL_FLAGS_FOR_STATIC_BUILD -X main.version_string=$1" -o tw ./twitter
|
||||||
else
|
else
|
||||||
go build -ldflags="$FLAGS" -o tw ./twitter
|
go build -ldflags="$FLAGS" -o tw ./twitter
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user