Skip to content

Commit

Permalink
update Makefile - remove weird env, add build specified for travis
Browse files Browse the repository at this point in the history
  • Loading branch information
ngtuna committed Dec 12, 2017
1 parent b105671 commit ad62a7d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ script:
export GOARCH="amd64"
go env
fi
- make VERSION="$VERSION" binary
- make VERSION="$VERSION" binary-travis
- file kubeapps

before_deploy:
Expand Down
16 changes: 9 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,28 @@ GO = /usr/bin/env GOPATH=$(GOPATH_TMP) $(GOBIN)
GOFMT = gofmt
VERSION = dev-$(shell date +%FT%T%z)

GO_OS = GOOS="${GOOS}"
GO_ARCH = GOARCH="${GOARCH}"
BINARY = kubeapps
GO_PACKAGES = $(IMPORT_PATH)/cmd $(IMPORT_PATH)/pkg/...
GO_FILES := $(shell find $(shell $(GOBIN) list -f '{{.Dir}}' $(GO_PACKAGES)) -name \*.go)
GO_FLAGS = -ldflags='-extldflags "-static" -w -X github.com/kubeapps/kubeapps/cmd.VERSION=${VERSION}'
GO_LDFLAGS =
GO_FLAGS = -ldflags='-w -X github.com/kubeapps/kubeapps/cmd.VERSION=${VERSION}'
EMBEDDED_STATIC = generated/statik/statik.go
CC_ = CC="${CC}"
CXX_ = CXX="${CXX}"

default: binary

binary: build-prep $(EMBEDDED_STATIC)
CGO_ENABLED=1 $(CC_) $(CXX_) $(GO_OS) $(GO_ARCH) $(GO) build -i -o $(BINARY) $(GO_FLAGS) $(IMPORT_PATH)
CGO_ENABLED=1 $(GO) build -i -o $(BINARY) $(GO_FLAGS) $(IMPORT_PATH)

binary-travis: build-prep $(EMBEDDED_STATIC)-travis
CGO_ENABLED=1 $(GO) build -i -o $(BINARY) $(GO_FLAGS) $(IMPORT_PATH)

test: build-prep $(EMBEDDED_STATIC)
$(GO) test $(GO_FLAGS) $(GO_PACKAGES)

$(EMBEDDED_STATIC): build-prep $(wilcard static/*)
$(GO) build -o statik ./vendor/github.com/rakyll/statik/statik.go
$(GO) generate

$(EMBEDDED_STATIC)-travis: build-prep $(wilcard static/*)
GOOS=linux $(GO) build -o statik ./vendor/github.com/rakyll/statik/statik.go
GOOS=linux $(GO) generate

Expand Down

0 comments on commit ad62a7d

Please sign in to comment.