From 675d7e39b07cfd41c597c0715b2da374c6b869a4 Mon Sep 17 00:00:00 2001 From: Hongchao Deng Date: Mon, 30 Jan 2017 12:42:03 -0800 Subject: [PATCH] build: speed up using "go install" --- hack/build/operator/build | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hack/build/operator/build b/hack/build/operator/build index ad53e74..3902087 100755 --- a/hack/build/operator/build +++ b/hack/build/operator/build @@ -16,18 +16,18 @@ fi : ${IMAGE:?"Need to set IMAGE, e.g. gcr.io/coreos-k8s-scale-testing/etcd-operator"} -bin_dir="_output/bin" +bin_dir="$(pwd)/_output/bin" mkdir -p ${bin_dir} || true ldKVPairs="github.com/coreos/etcd-operator/pkg/util/k8sutil.BackupImage=${IMAGE}" go_ldflags="-X ${ldKVPairs}" -CGO_ENABLED=0 go build -installsuffix cgo -ldflags "$go_ldflags" \ - -o ${bin_dir}/etcd-operator ./cmd/operator/main.go -CGO_ENABLED=0 go build -installsuffix cgo -ldflags "$go_ldflags" \ - -o ${bin_dir}/etcd-backup ./cmd/backup/main.go +GOBIN=${bin_dir} CGO_ENABLED=0 go install -installsuffix cgo -ldflags "$go_ldflags" ./cmd/operator/ +mv ${bin_dir}/operator ${bin_dir}/etcd-operator +GOBIN=${bin_dir} CGO_ENABLED=0 go install -installsuffix cgo -ldflags "$go_ldflags" ./cmd/backup/ +mv ${bin_dir}/backup ${bin_dir}/etcd-backup docker build --tag "${IMAGE}" -f hack/build/operator/Dockerfile . 1>/dev/null # For gcr users, do "gcloud docker -a" to have access.