go-run: Move temporary binary into `target` directory (#4657)

The `bin/go-run` script generates a temporary binary, stored in the root
of the repository.

This change moves it into `target/` so that is included in the
.dockerignore, and so that the repo can be cleaned easily by removing
the `target/` directory.
This commit is contained in:
Oliver Gould 2020-06-23 15:55:34 -07:00 committed by GitHub
parent d43ec41574
commit ca1a9f66d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

1
.gitignore vendored
View File

@ -9,7 +9,6 @@ web/web
**/node_modules
web/app/dist
web/app/yarn-error.log
.gorun
**/*.gogen*
**/*.swp
charts/**/charts

View File

@ -12,6 +12,7 @@ fi
version=$("$bindir"/root-tag)
ldflags="-X github.com/linkerd/linkerd2/pkg/version.Version=$version"
GO111MODULE=on go build -v -mod=readonly -race -o .gorun -ldflags "$ldflags" "./$1"
mkdir -p target
GO111MODULE=on go build -v -mod=readonly -race -o ./target/go-run -ldflags "$ldflags" "./$1"
shift
exec ./.gorun "$@"
exec ./target/go-run "$@"