jenkins-podman/Makefile
Stefan Reimer 26233b1eda
Some checks failed
ZeroDownTime/jenkins-podman/pipeline/head There was a failure building this commit
ci: improve Jenkinsfile
2022-01-13 14:30:51 +01:00

25 lines
592 B
Makefile

VERSION ?= 0.1.0
BASE ?= latest-alpine-jdk11
REGISTRY := public.ecr.aws/zero-downtime
REPOSITORY := jenkins-podman
TAG := $(REPOSITORY):v$(VERSION)
.PHONY: build push clean scan
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)
clean:
rm -f image.tar trivy-report.html
scan:
[ -f image.tar ] || podman save $(TAG) -o image.tar
trivy image --input image.tar