Skip to content

Commit e23e1d5

Browse files
author
Thomas Delbende
committed
chore: update releaser
1 parent 94e75ae commit e23e1d5

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

build.sh

+7-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -e
44

5-
GORELEASER_VERSION="v2.8.0"
5+
GORELEASER_VERSION="v2.8.2"
66
USER_UID=$(id -u)
77

88
rm -fr work
@@ -54,7 +54,7 @@ else
5454
rm -fr webui/dist webui/node_modules api/static/assets/css/ api/static/assets/js/ api/api-bindata.go api/api-packr.go api/packrd/
5555
fi
5656

57-
if [ "${SKIP_JS}" != "1" -a "${ONLY_GO}" != "1" ]; then
57+
if [ "${SKIP_JS}" != "1" ] && [ "${ONLY_GO}" != "1" ]; then
5858
echo "Building webui"
5959
mkdir -p api/static/assets/css/ api/static/assets/js/ webui/node_modules
6060
docker run --rm -e HOME=/go/pkg/node \
@@ -79,8 +79,7 @@ fi
7979

8080
export GLOUTON_VERSION
8181

82-
COMMIT=`git rev-parse --short HEAD || echo "unknown"`
83-
82+
COMMIT=$(git rev-parse --short HEAD || echo "unknown")
8483

8584
if [ "${ONLY_JS}" = "1" ]; then
8685
exit 0
@@ -90,21 +89,23 @@ echo "Building Go binary"
9089
if [ "${ONLY_DOCKER_FAST}" = "1" ]; then
9190
echo "Building a Docker image using ./glouton"
9291
sed 's@COPY dist/glouton_linux_.*/glouton /glouton.@COPY glouton /glouton.@' Dockerfile | docker buildx build ${GLOUTON_BUILDX_OPTION} -f - .
93-
elif [ "${ONLY_GO}" = "1" -a "${WITH_RACE}" != "1" ]; then
92+
elif [ "${ONLY_GO}" = "1" ] && [ "${WITH_RACE}" != "1" ]; then
9493
docker run --rm -e HOME=/go/pkg -e CGO_ENABLED=0 \
9594
-v $(pwd):/src -w /src ${GO_MOUNT_CACHE} \
9695
--entrypoint '' \
9796
goreleaser/goreleaser:${GORELEASER_VERSION} \
9897
tini -g -- sh -exc "
98+
git config --global --add safe.directory /src
9999
go build -ldflags='-X main.version=${GLOUTON_VERSION} -X main.commit=${COMMIT}' .
100100
chown $USER_UID glouton
101101
"
102-
elif [ "${ONLY_GO}" = "1" -a "${WITH_RACE}" = "1" ]; then
102+
elif [ "${ONLY_GO}" = "1" ] && [ "${WITH_RACE}" = "1" ]; then
103103
docker run --rm -e HOME=/go/pkg -e CGO_ENABLED=1 \
104104
-v $(pwd):/src -w /src ${GO_MOUNT_CACHE} \
105105
--entrypoint '' \
106106
goreleaser/goreleaser:${GORELEASER_VERSION} \
107107
tini -g -- sh -exc "
108+
git config --global --add safe.directory /src
108109
go build -ldflags='-X main.version=${GLOUTON_VERSION} -X main.commit=${COMMIT} -linkmode external -extldflags=-static' -race .
109110
chown $USER_UID glouton
110111
"

0 commit comments

Comments
 (0)