Skip to content

Commit

Permalink
Makefile: updates
Browse files Browse the repository at this point in the history
Signed-off-by: Hank Donnay <[email protected]>
  • Loading branch information
hdonnay committed Jul 28, 2023
1 parent da82839 commit da41c21
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,31 +52,19 @@ local-dev-quay: local-dev/clair/quay.yaml vendor
.PHONY: vendor
vendor: vendor/modules.txt

vendor/modules.txt: go.mod
vendor/modules.txt: go.mod $(shell find . -name vendor -prune -o -name *.go -print)
go mod vendor

comma := ,
volflags:= rw$(if $(findstring podman,$(docker)),$(comma)Z,)
build-vols := --volume "$$(go env GOMODCACHE):/go/pkg/mod:$(volflags)"\
--volume "$$(go env GOCACHE):/root/.cache/go-build:$(volflags)"

.PHONY: container-build
container-build:
ifneq ($(file < .git/HEAD),)
$(docker) build "--build-arg=CLAIR_VERSION=$$(git describe --match 'v4.*')" -t clair-local:latest .
else
$(docker) build -t clair-local:latest .
endif

DOCS_DIR ?= ../clair-doc
.PHONY: docs-build
docs-build:
mdbook build
rsync --recursive --delete-after --exclude 'v4.*' --exclude .git\
./book/ $(DOCS_DIR)/
$(docker) build $(build-vols) -t clair-local:latest .

contrib/openshift/grafana/dashboards/dashboard-clair.configmap.yaml: local-dev/grafana/provisioning/dashboards/dashboard.json contrib/openshift/grafana/dashboard-clair.configmap.yaml.tpl
sed "s/GRAFANA_MANIFEST/$$(sed -e 's/[\&/]/\\&/g' -e 's/$$/\\n/' -e 's/^/ /' $< | tr -d '\n')/" \
$(word 2,$^) \
> $@


# runs unit tests
.PHONY: unit
unit:
go test -race ./...

0 comments on commit da41c21

Please sign in to comment.