forked from aquasecurity/trivy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(makefile): add Makefile (aquasecurity#256)
* chore(makefile): add Makefile * chore(ci): use make * chore(makefile): add clean * chore(makefile): fix test commands * chore(ci): split tests into the unit test and the integration test
- Loading branch information
Showing
16 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
VERSION := $(shell git describe --tags) | ||
LDFLAGS=-ldflags "-s -w -X=main.version=$(VERSION)" | ||
|
||
GOPATH=$(shell go env GOPATH) | ||
GOBIN=$(GOPATH)/bin | ||
|
||
u := $(if $(update),-u) | ||
|
||
.PHONY: deps | ||
deps: | ||
go get ${u} -d | ||
go mod tidy | ||
|
||
$(GOBIN)/golangci-lint: | ||
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(GOBIN) v1.21.0 | ||
|
||
.PHONY: test | ||
test: | ||
go test -v -short ./... | ||
|
||
integration/testdata/fixtures/*.tar.gz: | ||
git clone https://github.com/aquasecurity/trivy-test-images.git integration/testdata/fixtures | ||
|
||
.PHONY: test-integration | ||
test-integration: integration/testdata/fixtures/*.tar.gz | ||
go test -v -tags=integration ./integration/... | ||
|
||
.PHONY: lint | ||
lint: $(GOBIN)/golangci-lint | ||
$(GOBIN)/golangci-lint run | ||
|
||
.PHONY: build | ||
build: | ||
go build $(LDFLAGS) ./cmd/trivy | ||
|
||
.PHONY: install | ||
install: | ||
go install $(LDFLAGS) ./cmd/trivy | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -rf integration/testdata/fixtures/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
// +build integration | ||
|
||
package integration_test | ||
|
||
import ( | ||
|
Oops, something went wrong.