Skip to content

Commit

Permalink
Add Makefile for cli project (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffwan authored Mar 14, 2022
1 parent 6941f6f commit c69cecb
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions cli/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
OUTPUT_NAME := kuberay
BUILD_GOOS = $(shell go env GOOS)

COMMIT := $(shell git rev-parse --short HEAD)
VERSION := $(shell git describe --tags $(shell git rev-list --tags --max-count=1))
DATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
REPO="github.com/ray-project/kuberay"

BUILD_FLAGS = -ldflags="-X '${REPO}/cli/pkg/cmd/version.Version=$(VERSION)' \
-X '${REPO}/cli/pkg/cmd/version.gitCommit=$(COMMIT)' \
-X '${REPO}/cli/pkg/cmd/version.buildDate=$(DATE)'"

build:
go build $(BUILD_FLAGS) -o $(OUTPUT_NAME) main.go
chmod +x $(OUTPUT_NAME)

# GOOS=linux GOARCH=amd64 make build
# GOOS=darwin GOARCH=amd64 make build

0 comments on commit c69cecb

Please sign in to comment.