From f9fe440401e179d8f3d546612cd6ea1b7b0e3f33 Mon Sep 17 00:00:00 2001 From: andres-portainer <91705312+andres-portainer@users.noreply.github.com> Date: Tue, 20 Sep 2022 18:48:07 -0300 Subject: [PATCH] feat(logging): trim paths from the build EE-4186 (#7710) --- build/build_binary.sh | 15 +++++++++------ build/build_binary_azuredevops.sh | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/build/build_binary.sh b/build/build_binary.sh index a9dc2da80..edabd80bc 100755 --- a/build/build_binary.sh +++ b/build/build_binary.sh @@ -1,3 +1,5 @@ +#!/bin/sh + set -x mkdir -p dist @@ -17,12 +19,13 @@ go get -t -d -v ./... # the build takes 2 seconds GOOS=$1 GOARCH=$2 CGO_ENABLED=0 go build \ --installsuffix cgo \ + --gcflags="-trimpath $(pwd)" \ --ldflags "-s \ - -X 'github.com/portainer/portainer/api/build.BuildNumber=${BUILDNUMBER}' \ - -X 'github.com/portainer/portainer/api/build.ImageTag=${CONTAINER_IMAGE_TAG}' \ - -X 'github.com/portainer/portainer/api/build.NodejsVersion=${NODE_VERSION}' \ - -X 'github.com/portainer/portainer/api/build.YarnVersion=${YARN_VERSION}' \ - -X 'github.com/portainer/portainer/api/build.WebpackVersion=${WEBPACK_VERSION}' \ - -X 'github.com/portainer/portainer/api/build.GoVersion=${GO_VERSION}'" \ + --X 'github.com/portainer/portainer/api/build.BuildNumber=${BUILDNUMBER}' \ + --X 'github.com/portainer/portainer/api/build.ImageTag=${CONTAINER_IMAGE_TAG}' \ + --X 'github.com/portainer/portainer/api/build.NodejsVersion=${NODE_VERSION}' \ + --X 'github.com/portainer/portainer/api/build.YarnVersion=${YARN_VERSION}' \ + --X 'github.com/portainer/portainer/api/build.WebpackVersion=${WEBPACK_VERSION}' \ + --X 'github.com/portainer/portainer/api/build.GoVersion=${GO_VERSION}'" \ -o "../dist/portainer" \ ./cmd/portainer/ diff --git a/build/build_binary_azuredevops.sh b/build/build_binary_azuredevops.sh index 9ebf89297..302c3ef9e 100755 --- a/build/build_binary_azuredevops.sh +++ b/build/build_binary_azuredevops.sh @@ -16,7 +16,7 @@ cp -R api ${GOPATH}/src/github.com/portainer/portainer/api cd 'api/cmd/portainer' go get -t -d -v ./... -GOOS=${PLATFORM} GOARCH=${ARCH} CGO_ENABLED=0 go build -a --installsuffix cgo --ldflags "-s \ +GOOS=${PLATFORM} GOARCH=${ARCH} CGO_ENABLED=0 go build -a --installsuffix cgo --gcflags="-trimpath $(pwd)" --ldflags "-s \ -X 'github.com/portainer/portainer/api/build.BuildNumber=${BUILDNUMBER}' \ -X 'github.com/portainer/portainer/api/build.ImageTag=${CONTAINER_IMAGE_TAG}' \ -X 'github.com/portainer/portainer/api/build.NodejsVersion=${NODE_VERSION}' \