cadvisor: build: fix broken build with Makefile

When using `make build` to compile the source,
build fails with error/s. The reason is because
of GO_CMD variable is set to 'install' as default,
which is not valid when running `make build` or
`make`.

Depending on the valid git tag, release.sh will
set the GO_CMD variable. If valid git tag is
available e.g.: vx.y.z.beta1, then GO_CMD is
set to `build`.

If valid git tag is not available, release.sh
will any way bails out serving the purpose.
So drop using GO_CMD, to fix the default build.
This commit is contained in:
Bhuvanchandra DV 2018-01-27 22:27:43 +05:30
parent 828ac5eb11
commit cbf13cdfa2
2 changed files with 1 additions and 3 deletions

View File

@ -17,7 +17,6 @@
set -e
GO_FLAGS=${GO_FLAGS:-"-tags netgo"} # Extra go flags to use in the build.
GO_CMD=${GO_CMD:-"install"}
BUILD_USER=${BUILD_USER:-"${USER}@${HOSTNAME}"}
BUILD_DATE=${BUILD_DATE:-$( date +%Y%m%d-%H:%M:%S )}
VERBOSE=${VERBOSE:-}
@ -50,6 +49,6 @@ if [ -n "$VERBOSE" ]; then
echo "Building with -ldflags $ldflags"
fi
GOBIN=$PWD go "$GO_CMD" ${GO_FLAGS} -ldflags "${ldflags}" "${repo_path}"
GOBIN=$PWD go build ${GO_FLAGS} -ldflags "${ldflags}" "${repo_path}"
exit 0

View File

@ -35,7 +35,6 @@ fi
# Build the release.
export BUILD_USER="$git_user"
export BUILD_DATE=$( date +%Y%m%d ) # Release date is only to day-granularity
export GO_CMD="build" # Don't use cached build objects for releases.
export VERBOSE=true
build/build.sh