Skip to content

Commit

Permalink
remove grype from bin
Browse files Browse the repository at this point in the history
  • Loading branch information
noboruma authored and gnmahanth committed Mar 27, 2024
1 parent 1bc8da9 commit 13b81b2
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ vendor:
go mod tidy -v
go mod vendor

.PHONY: cli
cli: vendor $(PWD)/**/*.go $(PWD)/agent-plugins-grpc/**/*.go
CGO_ENABLED=0 go build -tags cli -buildvcs=false -v -ldflags="-s -w -extldflags=-static" .

package-scanner: vendor $(PWD)/**/*.go $(PWD)/agent-plugins-grpc/**/*.go
CGO_ENABLED=0 go build -buildvcs=false -v -ldflags="-s -w -extldflags=-static" .

Expand All @@ -45,11 +49,11 @@ rm-buildx:
tools: grype syft

.PHONY: grype
grype:
grype:
(cd tools/grype-bin && ./get_grype.sh)

.PHONY: syft
syft:
syft:
(cd tools/syft-bin && ./get_syft.sh)

.PHONY: install-goreleaser
Expand Down
16 changes: 16 additions & 0 deletions tools/embed-cli.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//go:build cli
// +build cli

package tools

import (
_ "embed"
)

var (
//go:embed syft-bin/syft.bin
SyftBin []byte

//go:embed grype-bin/grype.bin
GrypeBin []byte
)
4 changes: 3 additions & 1 deletion tools/embed.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !cli
// +build !cli

package tools

import (
Expand All @@ -8,6 +11,5 @@ var (
//go:embed syft-bin/syft.bin
SyftBin []byte

//go:embed grype-bin/grype.bin
GrypeBin []byte
)

0 comments on commit 13b81b2

Please sign in to comment.