Skip to content
This repository was archived by the owner on Jan 9, 2023. It is now read-only.

Commit c970b6e

Browse files
committed
version for normal builds
1 parent 5b71107 commit c970b6e

2 files changed

Lines changed: 31 additions & 4 deletions

File tree

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ go_vet:
8888
go vet $$(go list ./pkg/... ./cmd/...| grep -v pkg/wing/client/clientset/internalversion/fake | grep -v pkg/wing/client/clientset/versioned/fake)
8989

9090
go_build_tagging_control:
91-
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -tags netgo -ldflags '-w -X main.version=$(CI_COMMIT_TAG) -X main.commit=$(CI_COMMIT_SHA) -X main.date=$(shell date -u +%Y-%m-%dT%H:%M:%SZ)' -o tagging_control_linux_amd64 ./cmd/tagging_control/.
91+
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -tags netgo -ldflags '-w $(shell hack/version-ldflags.sh)' -o tagging_control_linux_amd64 ./cmd/tagging_control
9292

9393
go_build:
9494
# Build a wing binary
95-
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -tags netgo -ldflags '-w -X main.version=$(CI_COMMIT_TAG) -X main.commit=$(CI_COMMIT_SHA) -X main.date=$(shell date -u +%Y-%m-%dT%H:%M:%SZ)' -o wing_linux_amd64 ./cmd/wing
95+
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -tags netgo -ldflags '-w $(shell hack/version-ldflags.sh)' -o wing_linux_amd64 ./cmd/wing
9696
ifeq ($(CI_COMMIT_TAG),dev)
9797
# Building in Dev mode
9898
# Build a hashable version of the wing binary without build variables
@@ -103,8 +103,8 @@ ifeq ($(CI_COMMIT_TAG),dev)
103103
go generate -tags devmode $$(go list ./pkg/... ./cmd/...)
104104
endif
105105
# Make sure you add all binaries to the .goreleaser.yml as well
106-
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -tags netgo -ldflags '-w -X main.version=$(CI_COMMIT_TAG) -X main.commit=$(CI_COMMIT_SHA) -X main.date=$(shell date -u +%Y-%m-%dT%H:%M:%SZ) -X github.com/jetstack/tarmak/pkg/terraform.wingHash=$(WING_HASH) -X main.wingHash=$(WING_HASH) -X github.com/jetstack/tarmak/cmd/tarmak/cmd.version=$(CI_COMMIT_TAG)' -o tarmak_linux_amd64 ./cmd/tarmak
107-
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -tags netgo -ldflags '-w -X main.version=$(CI_COMMIT_TAG) -X main.commit=$(CI_COMMIT_SHA) -X main.date=$(shell date -u +%Y-%m-%dT%H:%M:%SZ) -X github.com/jetstack/tarmak/pkg/terraform.wingHash=$(WING_HASH) -X main.wingHash=$(WING_HASH) -X github.com/jetstack/tarmak/cmd/tarmak/cmd.version=$(CI_COMMIT_TAG)' -o tarmak_darwin_amd64 ./cmd/tarmak
106+
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -tags netgo -ldflags '-w $(shell hack/version-ldflags.sh) -X github.com/jetstack/tarmak/pkg/terraform.wingHash=$(WING_HASH) -X main.wingHash=$(WING_HASH)' -o tarmak_linux_amd64 ./cmd/tarmak
107+
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -tags netgo -ldflags '-w $(shell hack/version-ldflags.sh) -X github.com/jetstack/tarmak/pkg/terraform.wingHash=$(WING_HASH) -X main.wingHash=$(WING_HASH)' -o tarmak_darwin_amd64 ./cmd/tarmak
108108

109109
$(BINDIR)/mockgen:
110110
mkdir -p $(BINDIR)

hack/version-ldflags.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2017 The Kubernetes Authors.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
# This command is used by bazel as the workspace_status_command
17+
# to implement build stamping with git information.
18+
19+
set -o errexit
20+
set -o nounset
21+
set -o pipefail
22+
23+
export KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
24+
25+
source "${KUBE_ROOT}/hack/lib/version.sh"
26+
KUBE_GO_PACKAGE=github.com/jetstack/tarmak
27+
kube::version::ldflags

0 commit comments

Comments
 (0)