Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
51 lines (40 sloc) 1.21 KB
ifeq ($(strip $(VERSION_STRING)),)
VERSION_STRING := $(shell git rev-parse --short HEAD)
endif
BINDIR := $(CURDIR)/bin
PLATFORMS := linux/amd64/okteto-Linux-x86_64 darwin/amd64/okteto-Darwin-x86_64 windows/amd64/okteto.exe linux/arm64/okteto-Linux-arm64
BUILDCOMMAND := go build -ldflags "-s -w -X github.com/okteto/okteto/pkg/config.VersionString=${VERSION_STRING}" -tags "osusergo netgo static_build"
temp = $(subst /, ,$@)
os = $(word 1, $(temp))
arch = $(word 2, $(temp))
label = $(word 3, $(temp))
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
SHACOMMAND := shasum -a 256
else
SHACOMMAND := sha256sum
endif
.DEFAULT_GOAL := build
.PHONY: release
build-all: $(PLATFORMS)
$(PLATFORMS):
GOOS=$(os) GOARCH=$(arch) CGO_ENABLED=0 $(BUILDCOMMAND) -o "bin/$(label)"
$(SHACOMMAND) "bin/$(label)" > "bin/$(label).sha256"
.PHONY: latest
latest:
echo ${VERSION_STRING} > bin/latest
.PHONY: lint
lint:
golangci-lint run
.PHONY: test
test:
go test -race -coverprofile=coverage.txt -covermode=atomic ./...
.PHONY: integration
integration:
go test github.com/okteto/okteto/integration -tags=integration --count=1 -v
.PHONY: build
build:
$(BUILDCOMMAND) -o ${BINDIR}/okteto
.PHONY: dep
dep:
GO111MODULE=on go mod tidy
You can’t perform that action at this time.