[scripts] Update various Go related scriptlets

This commit is contained in:
Ciprian Dorin Craciun 2019-08-22 14:53:12 +03:00
parent 7ec0ccede8
commit 8414abdbba

View file

@ -36,6 +36,7 @@
exec -- "${ZRUN[@]}" ':: go / tool' \ exec -- "${ZRUN[@]}" ':: go / tool' \
build \ build \
-v \ -v \
-mod readonly \
-o "${_outputs}/binaries/debug/kawipiko-server" \ -o "${_outputs}/binaries/debug/kawipiko-server" \
-- ./cmd/server.go \ -- ./cmd/server.go \
# #
@ -49,6 +50,7 @@
exec -- "${ZRUN[@]}" ':: go / tool' \ exec -- "${ZRUN[@]}" ':: go / tool' \
build \ build \
-v \ -v \
-mod readonly \
-tags netgo \ -tags netgo \
-ldflags 'all=-s -extld=gcc -extldflags=-static' \ -ldflags 'all=-s -extld=gcc -extldflags=-static' \
-gcflags 'all=-l=4' \ -gcflags 'all=-l=4' \
@ -65,6 +67,7 @@
exec -- "${ZRUN[@]}" ':: go / tool' \ exec -- "${ZRUN[@]}" ':: go / tool' \
build \ build \
-v \ -v \
-mod readonly \
-gcflags '-m' \ -gcflags '-m' \
-o "${_outputs}/binaries/debug/kawipiko-server" \ -o "${_outputs}/binaries/debug/kawipiko-server" \
-- ./cmd/server.go \ -- ./cmd/server.go \
@ -116,6 +119,7 @@
exec -- "${ZRUN[@]}" ':: go / tool' \ exec -- "${ZRUN[@]}" ':: go / tool' \
build \ build \
-v \ -v \
-mod readonly \
-o "${_outputs}/binaries/debug/kawipiko-archiver" \ -o "${_outputs}/binaries/debug/kawipiko-archiver" \
-- ./cmd/archiver.go \ -- ./cmd/archiver.go \
# #
@ -129,6 +133,7 @@
exec -- "${ZRUN[@]}" ':: go / tool' \ exec -- "${ZRUN[@]}" ':: go / tool' \
build \ build \
-v \ -v \
-mod readonly \
-tags 'netgo nobrotli' \ -tags 'netgo nobrotli' \
-ldflags 'all=-s -extld=gcc -extldflags=-static' \ -ldflags 'all=-s -extld=gcc -extldflags=-static' \
-gcflags 'all=-l=4' \ -gcflags 'all=-l=4' \
@ -156,6 +161,16 @@
<< go / build / all
test "${#}" -eq 0
"${ZRUN[@]}" ':: go / build / debug'
"${ZRUN[@]}" ':: go / build / release'
"${ZRUN[@]}" ':: go / build / publish'
!!
<< execute / wrapper / release << execute / wrapper / release
"${ZRUN[@]}" ':: go / build / wrapper / release' "${ZRUN[@]}" ':: go / build / wrapper / release'
exec -- env -i -- ./.outputs/binaries/release/kawipiko "${@}" exec -- env -i -- ./.outputs/binaries/release/kawipiko "${@}"
@ -170,6 +185,7 @@
exec -- "${ZRUN[@]}" ':: go / tool' \ exec -- "${ZRUN[@]}" ':: go / tool' \
build \ build \
-v \ -v \
-mod readonly \
-tags 'netgo nobrotli' \ -tags 'netgo nobrotli' \
-ldflags 'all=-s -extld=gcc -extldflags=-static' \ -ldflags 'all=-s -extld=gcc -extldflags=-static' \
-gcflags 'all=-l=4' \ -gcflags 'all=-l=4' \
@ -230,11 +246,9 @@
test "${#}" -eq 0 test "${#}" -eq 0
exec -- "${ZRUN[@]}" ':: go / tool' \ exec -- "${ZRUN[@]}" ':: go / tool' \
get \ get \
-v \ -m \
-d \ -d \
-u=patch \ -u \
-- \
./... \
# #
!! !!
@ -244,6 +258,7 @@
exec -- "${ZRUN[@]}" ':: go / tool' \ exec -- "${ZRUN[@]}" ':: go / tool' \
list \ list \
-m \ -m \
-mod readonly \
-- \ -- \
all \ all \
# #
@ -258,6 +273,23 @@
!! !!
<< go / dependencies / verify
test "${#}" -eq 0
exec -- "${ZRUN[@]}" ':: go / tool' \
mod verify \
#
!!
<< go / dependencies / upgrade
test "${#}" -eq 0
"${ZRUN[@]}" ':: go / dependencies / update'
"${ZRUN[@]}" ':: go / dependencies / tidy'
"${ZRUN[@]}" ':: go / dependencies / verify'
"${ZRUN[@]}" ':: go / dependencies / list'
!!
<< go / tool << go / tool
@ -269,6 +301,7 @@
export -- GOBIN="${_outputs}/go/bin" export -- GOBIN="${_outputs}/go/bin"
export -- GOTMPDIR="${_outputs}/go/tmp" export -- GOTMPDIR="${_outputs}/go/tmp"
export -- GOCACHE="${_outputs}/go/cache" export -- GOCACHE="${_outputs}/go/cache"
export -- GO111MODULE=on
cd -- "${_sources}" cd -- "${_sources}"
@ -610,6 +643,7 @@
"${ZRUN[@]}" ':: go / tool' \ "${ZRUN[@]}" ':: go / tool' \
build \ build \
-v \ -v \
-mod readonly \
-tags netgo \ -tags netgo \
-ldflags 'all=-s -extld=gcc -extldflags=-static' \ -ldflags 'all=-s -extld=gcc -extldflags=-static' \
-gcflags 'all=-l=4' \ -gcflags 'all=-l=4' \