2021-01-06 23:53:05 +03:00
|
|
|
|
|
|
|
# Image URL to use all building/pushing image targets
|
2021-01-11 21:33:20 +03:00
|
|
|
IMG ?= mcr.microsoft.com/aks/canipull:v0.0.2-alpha
|
2021-01-06 23:53:05 +03:00
|
|
|
|
|
|
|
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
|
|
|
|
ifeq (,$(shell go env GOBIN))
|
|
|
|
GOBIN=$(shell go env GOPATH)/bin
|
|
|
|
else
|
|
|
|
GOBIN=$(shell go env GOBIN)
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Run tests
|
|
|
|
test: fmt vet
|
|
|
|
go test ./... -coverprofile=cover.out -covermode=atomic
|
|
|
|
|
|
|
|
fmt:
|
|
|
|
go fmt ./...
|
|
|
|
|
|
|
|
# Run go vet against code
|
|
|
|
vet:
|
|
|
|
go vet ./...
|
|
|
|
|
|
|
|
# Build the docker image
|
|
|
|
docker-build: test
|
|
|
|
docker build . -t ${IMG}
|
|
|
|
|
|
|
|
# Push the docker image
|
|
|
|
docker-push:
|
|
|
|
docker push ${IMG}
|