-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Makefile
44 lines (34 loc) · 950 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
GOFLAGS=-trimpath
LDFLAGS="-s -w"
build:
mkdir -p ./bin
CGO_ENABLED=0 go build -v ${GOFLAGS} -ldflags=${LDFLAGS} -o ./bin/cyclonedx-gomod ./cmd/cyclonedx-gomod
.PHONY: build
install:
CGO_ENABLED=0 go install -v ${GOFLAGS} -ldflags=${LDFLAGS} ./cmd/cyclonedx-gomod
.PHONY: install
unit-test:
go test -v -short -cover ./...
.PHONY: unit-test
test:
go test -v -cover ./...
.PHONY: test
clean:
rm -rf ./bin
rm -rf ./dist
go clean -testcache
.PHONY: clean
docker:
docker build -t cyclonedx/cyclonedx-gomod -f Dockerfile .
.PHONY: docker
goreleaser-dryrun:
goreleaser release --skip publish,sign --snapshot
.PHONY: goreleaser-dryrun
build-examples-image:
docker build -t cyclonedx/cyclonedx-gomod:examples -f Dockerfile.examples .
.PHONY: build-examples-image
examples: build-examples-image
docker run -it --rm -v "$(shell pwd)/examples:/examples" cyclonedx/cyclonedx-gomod:examples
.PHONY: examples
all: clean build test
.PHONY: all