2021-12-16 09:28:22 +00:00
|
|
|
#!/dev/null
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<< go / build / server / debug
|
|
|
|
test "${#}" -eq 0
|
|
|
|
_outputs="$( exec -- readlink -e -- ./.outputs )"
|
|
|
|
if test -e "${_outputs}/binaries/debug/kawipiko-server" ; then
|
|
|
|
rm -- "${_outputs}/binaries/debug/kawipiko-server"
|
|
|
|
fi
|
|
|
|
exec -- \
|
|
|
|
nodaemon \
|
|
|
|
nice -n 19 \
|
|
|
|
"${ZRUN[@]}" ':: go / tool' \
|
|
|
|
build \
|
|
|
|
-o "${_outputs}/binaries/debug/kawipiko-server" \
|
|
|
|
-- ./cmd/server.go \
|
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
2021-12-17 09:56:52 +00:00
|
|
|
<< go / build / server / release / quick
|
|
|
|
export -- _BUILD_QUICK=true
|
|
|
|
exec -- "${ZRUN[@]}" ':: go / build / server / release' "${@}"
|
|
|
|
!!
|
|
|
|
|
2021-12-16 09:28:22 +00:00
|
|
|
<< go / build / server / release
|
|
|
|
test "${#}" -eq 0
|
|
|
|
_outputs="$( exec -- readlink -e -- ./.outputs )"
|
|
|
|
if test -e "${_outputs}/binaries/release/kawipiko-server" ; then
|
|
|
|
rm -- "${_outputs}/binaries/release/kawipiko-server"
|
|
|
|
fi
|
2021-12-21 18:27:02 +00:00
|
|
|
_flags=(
|
|
|
|
-tags netgo
|
|
|
|
)
|
2021-12-17 09:56:52 +00:00
|
|
|
if test -z "${_BUILD_QUICK:-}" ; then
|
|
|
|
_flags+=(
|
|
|
|
-gcflags 'all=-l=4'
|
|
|
|
-ldflags 'all=-s'
|
|
|
|
-buildmode exe
|
|
|
|
-trimpath
|
2021-12-21 18:27:02 +00:00
|
|
|
-a
|
2021-12-17 09:56:52 +00:00
|
|
|
)
|
|
|
|
fi
|
2021-12-16 09:28:22 +00:00
|
|
|
exec -- \
|
|
|
|
nodaemon \
|
|
|
|
nice -n 19 -- \
|
|
|
|
"${ZRUN[@]}" ':: go / tool' \
|
|
|
|
build \
|
2021-12-17 09:56:52 +00:00
|
|
|
"${_flags[@]}" \
|
2021-12-16 09:28:22 +00:00
|
|
|
-o "${_outputs}/binaries/release/kawipiko-server" \
|
|
|
|
-- ./cmd/server.go \
|
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<< go / build / archiver / debug
|
|
|
|
test "${#}" -eq 0
|
|
|
|
_outputs="$( exec -- readlink -e -- ./.outputs )"
|
|
|
|
if test -e "${_outputs}/binaries/debug/kawipiko-archiver" ; then
|
|
|
|
rm -- ${_outputs}/binaries/debug/kawipiko-archiver
|
|
|
|
fi
|
|
|
|
exec -- \
|
|
|
|
nodaemon \
|
|
|
|
nice -n 19 -- \
|
|
|
|
"${ZRUN[@]}" ':: go / tool' \
|
|
|
|
build \
|
|
|
|
-o "${_outputs}/binaries/debug/kawipiko-archiver" \
|
|
|
|
-- ./cmd/archiver.go \
|
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
2021-12-17 09:56:52 +00:00
|
|
|
|
|
|
|
<< go / build / archiver / release / quick
|
|
|
|
export -- _BUILD_QUICK=true
|
|
|
|
exec -- "${ZRUN[@]}" ':: go / build / archiver / release' "${@}"
|
|
|
|
!!
|
|
|
|
|
2021-12-16 09:28:22 +00:00
|
|
|
<< go / build / archiver / release
|
|
|
|
test "${#}" -eq 0
|
|
|
|
_outputs="$( exec -- readlink -e -- ./.outputs )"
|
|
|
|
if test -e "${_outputs}/binaries/release/kawipiko-archiver" ; then
|
|
|
|
rm -- "${_outputs}/binaries/release/kawipiko-archiver"
|
|
|
|
fi
|
2021-12-21 18:27:02 +00:00
|
|
|
_flags=(
|
|
|
|
-tags netgo
|
|
|
|
)
|
2021-12-17 09:56:52 +00:00
|
|
|
if test -z "${_BUILD_QUICK:-}" ; then
|
|
|
|
_flags+=(
|
|
|
|
-gcflags 'all=-l=4'
|
|
|
|
-ldflags 'all=-s'
|
|
|
|
-buildmode exe
|
|
|
|
-trimpath
|
2021-12-21 18:27:02 +00:00
|
|
|
-a
|
2021-12-17 09:56:52 +00:00
|
|
|
)
|
|
|
|
fi
|
2021-12-16 09:28:22 +00:00
|
|
|
exec -- \
|
|
|
|
nodaemon \
|
|
|
|
nice -n 19 -- \
|
|
|
|
"${ZRUN[@]}" ':: go / tool' \
|
|
|
|
build \
|
2021-12-17 09:56:52 +00:00
|
|
|
"${_flags[@]}" \
|
2021-12-16 09:28:22 +00:00
|
|
|
-o "${_outputs}/binaries/release/kawipiko-archiver" \
|
|
|
|
-- ./cmd/archiver.go \
|
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<< go / build / wrapper / debug
|
|
|
|
test "${#}" -eq 0
|
|
|
|
_outputs="$( exec -- readlink -e -- ./.outputs )"
|
|
|
|
if test -e "${_outputs}/binaries/debug/kawipiko-wrapper" ; then
|
|
|
|
rm -- "${_outputs}/binaries/debug/kawipiko-wrapper"
|
|
|
|
fi
|
|
|
|
exec -- \
|
|
|
|
nodaemon \
|
|
|
|
nice -n 19 \
|
|
|
|
"${ZRUN[@]}" ':: go / tool' \
|
|
|
|
build \
|
|
|
|
-o "${_outputs}/binaries/debug/kawipiko-wrapper" \
|
|
|
|
-- ./cmd/wrapper.go \
|
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
<< go / build / wrapper / release
|
|
|
|
test "${#}" -eq 0
|
|
|
|
_outputs="$( exec -- readlink -e -- ./.outputs )"
|
|
|
|
if test -e "${_outputs}/binaries/release/kawipiko-wrapper" ; then
|
|
|
|
rm -- "${_outputs}/binaries/release/kawipiko-wrapper"
|
|
|
|
fi
|
|
|
|
exec -- \
|
|
|
|
nodaemon \
|
|
|
|
nice -n 19 -- \
|
|
|
|
"${ZRUN[@]}" ':: go / tool' \
|
|
|
|
build \
|
|
|
|
-tags netgo \
|
|
|
|
-a \
|
|
|
|
-gcflags 'all=-l=4' \
|
|
|
|
-ldflags 'all=-s' \
|
|
|
|
-buildmode exe \
|
|
|
|
-trimpath \
|
|
|
|
-o "${_outputs}/binaries/release/kawipiko-wrapper" \
|
|
|
|
-- ./cmd/wrapper.go \
|
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-16 09:54:42 +00:00
|
|
|
<< go / build / server-dummy / debug
|
|
|
|
test "${#}" -eq 0
|
|
|
|
_outputs="$( exec -- readlink -e -- ./.outputs )"
|
|
|
|
if test -e "${_outputs}/binaries/debug/kawipiko-server-dummy" ; then
|
|
|
|
rm -- "${_outputs}/binaries/debug/kawipiko-server-dummy"
|
|
|
|
fi
|
|
|
|
exec -- \
|
|
|
|
nodaemon \
|
|
|
|
nice -n 19 \
|
|
|
|
"${ZRUN[@]}" ':: go / tool' \
|
|
|
|
build \
|
|
|
|
-o "${_outputs}/binaries/debug/kawipiko-server-dummy" \
|
|
|
|
-- ./cmd/server-dummy.go \
|
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
2021-12-17 09:56:52 +00:00
|
|
|
<< go / build / server-dummy / release / quick
|
|
|
|
export -- _BUILD_QUICK=true
|
|
|
|
exec -- "${ZRUN[@]}" ':: go / build / server-dummy / release' "${@}"
|
|
|
|
!!
|
|
|
|
|
2021-12-16 09:54:42 +00:00
|
|
|
<< go / build / server-dummy / release
|
|
|
|
test "${#}" -eq 0
|
|
|
|
_outputs="$( exec -- readlink -e -- ./.outputs )"
|
|
|
|
if test -e "${_outputs}/binaries/release/kawipiko-server-dummy" ; then
|
|
|
|
rm -- "${_outputs}/binaries/release/kawipiko-server-dummy"
|
|
|
|
fi
|
2021-12-21 18:27:02 +00:00
|
|
|
_flags=(
|
|
|
|
-tags netgo
|
|
|
|
)
|
2021-12-17 09:56:52 +00:00
|
|
|
if test -z "${_BUILD_QUICK:-}" ; then
|
|
|
|
_flags+=(
|
|
|
|
-gcflags 'all=-l=4'
|
|
|
|
-ldflags 'all=-s'
|
|
|
|
-buildmode exe
|
|
|
|
-trimpath
|
2021-12-21 18:27:02 +00:00
|
|
|
-a
|
2021-12-17 09:56:52 +00:00
|
|
|
)
|
|
|
|
fi
|
2021-12-16 09:54:42 +00:00
|
|
|
exec -- \
|
|
|
|
nodaemon \
|
|
|
|
nice -n 19 -- \
|
|
|
|
"${ZRUN[@]}" ':: go / tool' \
|
|
|
|
build \
|
2021-12-17 09:56:52 +00:00
|
|
|
"${_flags[@]}" \
|
2021-12-16 09:54:42 +00:00
|
|
|
-o "${_outputs}/binaries/release/kawipiko-server-dummy" \
|
|
|
|
-- ./cmd/server-dummy.go \
|
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-16 09:28:22 +00:00
|
|
|
<< go / build / all / release
|
|
|
|
test "${#}" -eq 0
|
|
|
|
_outputs="$( exec -- readlink -e -- ./.outputs )"
|
|
|
|
for _platform in linux darwin openbsd freebsd ; do
|
|
|
|
for _component in archiver server wrapper ; do
|
|
|
|
if test -e "${_outputs}/binaries/release/kawipiko-${_component}--${_platform}" ; then
|
|
|
|
rm -f -- "${_outputs}/binaries/release/kawipiko-${_component}--${_platform}"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
|
|
|
for _platform in linux darwin openbsd freebsd ; do
|
|
|
|
for _component in archiver server wrapper ; do
|
|
|
|
printf -- '[ii] building `%s` for `%s`...\n' "${_component}" "${_platform}" >&2
|
|
|
|
env GOOS="${_platform}" \
|
|
|
|
nodaemon \
|
|
|
|
nice -n 19 -- \
|
|
|
|
"${ZRUN[@]}" ':: go / tool' \
|
|
|
|
build \
|
|
|
|
-tags netgo \
|
|
|
|
-a \
|
|
|
|
-gcflags 'all=-l=4' \
|
|
|
|
-ldflags 'all=-s' \
|
|
|
|
-buildmode exe \
|
|
|
|
-trimpath \
|
|
|
|
-o "${_outputs}/binaries/release/kawipiko-${_component}--${_platform}" \
|
|
|
|
-- "./cmd/${_component}.go" \
|
|
|
|
#
|
|
|
|
done
|
|
|
|
done
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<< go / build / all / publish
|
|
|
|
test "${#}" -eq 0
|
|
|
|
for _platform in linux darwin openbsd freebsd ; do
|
|
|
|
for _component in archiver server wrapper ; do
|
|
|
|
cp -T -- \
|
|
|
|
"./.outputs/binaries/release/kawipiko-${_component}--${_platform}" \
|
|
|
|
"./.outputs/publish/binaries/kawipiko-${_component}--${_platform}" \
|
|
|
|
#
|
|
|
|
done
|
|
|
|
done
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<< go / build / server / analyze
|
|
|
|
test "${#}" -eq 0
|
|
|
|
_outputs="$( exec -- readlink -e -- ./.outputs )"
|
|
|
|
exec -- "${ZRUN[@]}" ':: go / tool' \
|
|
|
|
build \
|
2021-12-16 10:05:13 +00:00
|
|
|
-a \
|
2021-12-16 09:28:22 +00:00
|
|
|
-gcflags '-m' \
|
2021-12-17 09:56:52 +00:00
|
|
|
-o "${_outputs}/binaries/analyze/kawipiko-server" \
|
2021-12-16 10:05:13 +00:00
|
|
|
-- ./cmd/server/server.go \
|
2021-12-16 09:28:22 +00:00
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
<< go / build / server / analyze / escapes
|
|
|
|
"${ZRUN[@]}" ':: go / build / server / analyze' "${@}" \
|
|
|
|
2>&1 \
|
|
|
|
| grep -F -e ' escapes ' \
|
|
|
|
| LC_ALL=C sort -n -k 2,2 -t ':'
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<< go / dependencies / update
|
|
|
|
test "${#}" -eq 0
|
|
|
|
exec -- "${ZRUN[@]}" ':: go / tool' \
|
|
|
|
get \
|
|
|
|
-v \
|
|
|
|
-d \
|
|
|
|
-u \
|
|
|
|
-- \
|
|
|
|
all \
|
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
<< go / dependencies / list
|
|
|
|
test "${#}" -eq 0
|
|
|
|
exec -- "${ZRUN[@]}" ':: go / tool' \
|
|
|
|
list \
|
|
|
|
-m \
|
|
|
|
-- \
|
|
|
|
all \
|
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
<< go / dependencies / tidy
|
|
|
|
test "${#}" -eq 0
|
|
|
|
exec -- "${ZRUN[@]}" ':: go / tool' \
|
|
|
|
mod tidy \
|
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
<< 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
|
|
|
|
test "${#}" -ge 1
|
|
|
|
|
|
|
|
_outputs="$( exec -- readlink -e -- ./.outputs )"
|
|
|
|
_sources="$( exec -- readlink -e -- ./sources )"
|
|
|
|
|
|
|
|
export -- GOPATH="${_outputs}/go"
|
|
|
|
export -- GOBIN="${_outputs}/go/bin"
|
|
|
|
export -- GOTMPDIR="${_outputs}/go/tmp"
|
|
|
|
export -- GOCACHE="${_outputs}/go/cache"
|
|
|
|
export -- GO111MODULE=on
|
|
|
|
|
|
|
|
cd -- "${_sources}"
|
|
|
|
|
|
|
|
exec -- go "${@}"
|
|
|
|
!!
|
|
|
|
|