1
1
mirror of https://github.com/goreleaser/nfpm synced 2024-11-18 23:14:12 +01:00
nfpm/Makefile
Carlos Alexandro Becker 19817233b5
feat: remove deprecated options (#267)
* feat: remove deprecated options

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* test: fixing

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: configs

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: tempdir

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: fmt

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* feat: go 1.15

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* test: fix

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* test: fix

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* test: fix

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: tests

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* refactor: test

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: lint

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: import

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: test

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: symlink

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-12-22 21:28:32 -03:00

80 lines
2.1 KiB
Makefile

SOURCE_FILES?=./...
TEST_PATTERN?=.
TEST_OPTIONS?=
TEST_TIMEOUT?=15m
TEST_PARALLEL?=2
export PATH := ./bin:$(PATH)
export GO111MODULE := on
export GOPROXY := https://proxy.golang.org,https://gocenter.io,direct
# Install all the build and lint dependencies
setup:
go mod download
go generate -v ./...
git config core.hooksPath .githooks
.PHONY: setup
pull_test_imgs:
grep FROM ./testdata/acceptance/*.dockerfile | cut -f2 -d' ' | sort | uniq | while read -r img; do docker pull "$$img"; done
.PHONY: pull_test_imgs
acceptance: pull_test_imgs
make -e TEST_OPTIONS="-tags=acceptance" test
.PHONY: acceptance
test:
go test $(TEST_OPTIONS) -p $(TEST_PARALLEL) -v -failfast -race -coverpkg=./... -covermode=atomic -coverprofile=coverage.txt $(SOURCE_FILES) -run $(TEST_PATTERN) -timeout=$(TEST_TIMEOUT)
.PHONY: test
cover: test
go tool cover -html=coverage.txt
.PHONY: cover
fmt:
find . -name '*.go' -not -wholename './vendor/*' | while read -r file; do gofmt -w -s "$$file"; goimports -w "$$file"; done
.PHONY: fmt
lint: check
golangci-lint run
.PHONY: check
ci: build lint test acceptance
.PHONY: ci
build:
go build -o nfpm ./cmd/nfpm/main.go
.PHONY: build
deps:
go get -u
go mod tidy
go mod verify
.PHONY: deps
imgs:
wget -O www/docs/static/logo.png https://github.com/goreleaser/artwork/raw/master/goreleaserfundo.png
wget -O www/docs/static/card.png "https://og.caarlos0.dev/**NFPM**%20|%20A%20simple%20Deb%20and%20RPM%20packager%20written%20in%20Go.png?theme=light&md=1&fontSize=80px&images=https://github.com/goreleaser.png"
wget -O www/docs/static/avatar.png https://github.com/goreleaser.png
convert www/docs/static/avatar.png -define icon:auto-resize=64,48,32,16 www/docs/static/favicon.ico
convert www/docs/static/avatar.png -resize x120 www/docs/static/apple-touch-icon.png
.PHONY: imgs
serve:
@docker run --rm -it -p 8000:8000 -v ${PWD}/www:/docs squidfunk/mkdocs-material
.PHONY: serve
todo:
@grep \
--exclude-dir=vendor \
--exclude-dir=node_modules \
--exclude-dir=bin \
--exclude=Makefile \
--text \
--color \
-nRo -E ' TODO:.*|SkipNow' .
.PHONY: todo
.DEFAULT_GOAL := build