2022-01-13 23:47:45 +00:00
|
|
|
VERSION ?= 0.2.0
|
2022-01-13 11:41:17 +00:00
|
|
|
BASE ?= latest-alpine-jdk11
|
|
|
|
REGISTRY := public.ecr.aws/zero-downtime
|
|
|
|
REPOSITORY := jenkins-podman
|
|
|
|
TAG := $(REPOSITORY):v$(VERSION)
|
|
|
|
|
2022-01-13 15:53:54 +00:00
|
|
|
ifeq ($(TRIVY_REMOTE),)
|
|
|
|
TRIVY_OPTS := image
|
|
|
|
else
|
|
|
|
TRIVY_OPTS := client --remote ${TRIVY_REMOTE}
|
|
|
|
endif
|
|
|
|
|
2022-01-13 23:47:45 +00:00
|
|
|
.PHONY: build push scan
|
2022-01-13 11:41:17 +00:00
|
|
|
|
|
|
|
all: build
|
|
|
|
|
|
|
|
build:
|
|
|
|
podman build --rm --squash-all --build-arg BASE=$(BASE) -t $(TAG) .
|
|
|
|
|
|
|
|
push:
|
|
|
|
aws ecr-public get-login-password --region us-east-1 | podman login --username AWS --password-stdin $(REGISTRY)
|
|
|
|
podman tag $(TAG) $(REGISTRY)/$(TAG)
|
|
|
|
podman push $(REGISTRY)/$(TAG)
|
|
|
|
|
|
|
|
scan:
|
2022-01-13 23:47:45 +00:00
|
|
|
trivy $(TRIVY_OPTS) $(TAG)
|