...

Text file src/github.com/instrumenta/kubeval/Makefile

Documentation: github.com/instrumenta/kubeval

     1NAME=kubeval
     2IMAGE_NAME=garethr/$(NAME)
     3PACKAGE_NAME=github.com/instrumenta/$(NAME)
     4GOFMT_FILES?=$$(find . -name '*.go' | grep -v vendor)
     5TAG=$(shell git describe --abbrev=0 --tags)
     6
     7
     8all: build
     9
    10$(GOPATH)/bin/golint$(suffix):
    11	go get github.com/golang/lint/golint
    12
    13$(GOPATH)/bin/goveralls$(suffix):
    14	go get github.com/mattn/goveralls
    15
    16vendor:
    17	go mod vendor
    18
    19.bats:
    20	git clone --depth 1 https://github.com/sstephenson/bats.git .bats
    21
    22bin:
    23	mkdir bin
    24
    25release:
    26	goreleaser --rm-dist
    27
    28snapshot:
    29	goreleaser --snapshot --skip-publish --rm-dist
    30
    31build: bin
    32	go build -o bin/$(NAME) .
    33
    34lint: $(GOPATH)/bin/golint$(suffix)
    35	golint
    36
    37docker:
    38	docker build -t $(IMAGE_NAME):$(TAG) .
    39	docker tag $(IMAGE_NAME):$(TAG) $(IMAGE_NAME):latest
    40	docker push $(IMAGE_NAME):$(TAG)
    41	docker push $(IMAGE_NAME):latest
    42
    43docker-offline:
    44	docker build -f Dockerfile.offline -t $(IMAGE_NAME):$(TAG)-offline .
    45	docker tag $(IMAGE_NAME):$(TAG)-offline $(IMAGE_NAME):offline
    46
    47vet:
    48	go vet
    49
    50test: vet
    51	go test -race -v -cover ./...
    52
    53watch:
    54	ls */*.go | entr make test
    55
    56acceptance:
    57	docker build -f Dockerfile.acceptance -t $(IMAGE_NAME):$(TAG)-acceptance .
    58	docker tag $(IMAGE_NAME):$(TAG)-acceptance $(IMAGE_NAME):acceptance
    59
    60cover:
    61	go test -v ./$(NAME) -coverprofile=coverage.out
    62	go tool cover -html=coverage.out
    63	rm coverage.out
    64
    65clean:
    66	rm -fr dist bin
    67
    68fmt:
    69	gofmt -w $(GOFMT_FILES)
    70
    71dist/$(NAME)-checksum-%:
    72	cd dist && sha256sum $@.zip
    73
    74checksums: dist/$(NAME)-checksum-darwin-amd64 dist/$(NAME)-checksum-windows-386 dist/$(NAME)-checksum-windows-amd64 dist/$(NAME)-checksum-linux-amd64
    75
    76chocolatey/$(NAME)/$(NAME).$(TAG).nupkg: chocolatey/$(NAME)/$(NAME).nuspec
    77	cd chocolatey/$(NAME) && choco pack
    78
    79choco:
    80	cd chocolatey/$(NAME) && choco push $(NAME).$(TAG).nupkg -s https://chocolatey.org/
    81
    82.PHONY: release snapshot fmt clean cover acceptance lint docker test vet watch build check choco checksums

View as plain text