Skip to content

Commit

Permalink
Fix build-cli-bin to use generated templates (#2341)
Browse files Browse the repository at this point in the history
The `bin/build-cli-bin` script, intended to build a local `linkerd` cli
binary, was compiling the binary configured to read template files out
of the local machine's GOPATH.

This change modifies `build-cli-bin` to build a `linkerd` binary the
same way `docker-build-cli-bin` does. Specifically, by generating static
template files for inclusion in the build, and adding the `-tags prod`
flag to ensure those files are compiled in.

Signed-off-by: Andrew Seigner <[email protected]>
  • Loading branch information
siggy authored and klingerf committed Feb 21, 2019
1 parent 42c0278 commit 5e47cb1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/build-cli-bin
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ fi
$bindir/dep ensure -vendor-only -v
fi
target="target/cli/${host_platform}/linkerd"
CGO_ENABLED=0 go build -o $target -ldflags "-s -w -X github.com/linkerd/linkerd2/pkg/version.Version=$($bindir/root-tag)" ./cli
go generate ./cli
CGO_ENABLED=0 go build -o $target -tags prod -ldflags "-s -w -X github.com/linkerd/linkerd2/pkg/version.Version=$($bindir/root-tag)" ./cli
echo "$target"
)

0 comments on commit 5e47cb1

Please sign in to comment.