fix: fix trivy scan task to match new flow, add BRANCH env to Makefile
This commit is contained in:
parent
38cf7ab7d3
commit
7378ea9a24
@ -1,6 +1,7 @@
|
|||||||
# Parse version from latest git semver tag
|
# Parse version from latest git semver tag
|
||||||
GTAG=$(shell git describe --tags --match v*.*.* 2>/dev/null || git rev-parse --short HEAD 2>/dev/null)
|
BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
|
||||||
TAG ?= $(shell echo $(GTAG) | awk -F '-' '{ print $$1 "-" $$2 }' | sed -e 's/-$$//')
|
GIT_TAG=$(shell git describe --tags --match v*.*.* 2>/dev/null || git rev-parse --short HEAD 2>/dev/null)
|
||||||
|
TAG ?= $(shell echo $(GIT_TAG) | awk -F '-' '{ print $$1 "-" $$2 }' | sed -e 's/-$$//')
|
||||||
ARCH := amd64
|
ARCH := amd64
|
||||||
ALL_ARCHS := amd64 arm64
|
ALL_ARCHS := amd64 arm64
|
||||||
|
|
||||||
@ -30,8 +31,8 @@ test: rm-test-image ## Execute Dockerfile.test
|
|||||||
echo "No Dockerfile.test found, skipping test"
|
echo "No Dockerfile.test found, skipping test"
|
||||||
|
|
||||||
scan: ## Scan image using trivy
|
scan: ## Scan image using trivy
|
||||||
echo "Scanning $(REGISTRY)/$(IMAGE):$(TAG)-$(ARCH) using Trivy $(TRIVY_REMOTE)"
|
echo "Scanning $(IMAGE):$(TAG)-$(ARCH) using Trivy $(TRIVY_REMOTE)"
|
||||||
trivy image $(TRIVY_OPTS) $(REGISTRY)/$(IMAGE):$(TAG)-$(ARCH)
|
trivy image $(TRIVY_OPTS) $(IMAGE):$(TAG)-$(ARCH)
|
||||||
|
|
||||||
# first tag and push all actual images
|
# first tag and push all actual images
|
||||||
# create new manifest for each tag and add all available TAG-ARCH before pushing
|
# create new manifest for each tag and add all available TAG-ARCH before pushing
|
||||||
|
Loading…
Reference in New Issue
Block a user