fix: clean hidden whitespaces

This commit is contained in:
Stefan Reimer 2022-02-09 12:22:59 +01:00
parent d1550df17a
commit 4c6fb57ef7

View File

@ -1,40 +1,40 @@
REGISTRY := public.ecr.aws/zero-downtime REGISTRY := public.ecr.aws/zero-downtime
REPOSITORY := sns-alert-hub REPOSITORY := sns-alert-hub
REGION := us-east-1 REGION := us-east-1
# 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) GTAG=$(shell git describe --tags --match v*.*.* 2>/dev/null || git rev-parse --short HEAD 2>/dev/null)
TAG ?= $(shell echo $(GTAG) | awk -F '-' '{ print $$1 "-" $$2 }' | sed -e 's/-$$//') TAG ?= $(shell echo $(GTAG) | awk -F '-' '{ print $$1 "-" $$2 }' | sed -e 's/-$$//')
ifeq ($(TRIVY_REMOTE),) ifeq ($(TRIVY_REMOTE),)
TRIVY_OPTS := image TRIVY_OPTS := image
else else
TRIVY_OPTS := client --remote ${TRIVY_REMOTE} TRIVY_OPTS := client --remote ${TRIVY_REMOTE}
endif endif
.PHONY: build push scan test .PHONY: build push scan test
all: build all: build
build: build:
podman build --rm --squash-all -t $(REPOSITORY):$(TAG) -t $(REPOSITORY):latest . podman build --rm --squash-all -t $(REPOSITORY):$(TAG) -t $(REPOSITORY):latest .
push: push:
aws ecr-public get-login-password --region $(REGION) | podman login --username AWS --password-stdin $(REGISTRY) aws ecr-public get-login-password --region $(REGION) | podman login --username AWS --password-stdin $(REGISTRY)
podman tag $(REPOSITORY):latest $(REGISTRY)/$(REPOSITORY):$(TAG) $(REGISTRY)/$(REPOSITORY):latest podman tag $(REPOSITORY):latest $(REGISTRY)/$(REPOSITORY):$(TAG) $(REGISTRY)/$(REPOSITORY):latest
podman push $(REGISTRY)/$(REPOSITORY):$(TAG) podman push $(REGISTRY)/$(REPOSITORY):$(TAG)
podman push $(REGISTRY)/$(REPOSITORY):latest podman push $(REGISTRY)/$(REPOSITORY):latest
# Delete all untagged images # Delete all untagged images
# aws ecr-public batch-delete-image --repository-name $(REPOSITORY) --region $(REGION) --image-ids $$(for image in $$(aws ecr-public describe-images --repository-name $(REPOSITORY) --region $(REGION) --output json | jq -r '.imageDetails[] | select(.imageTags | not ).imageDigest'); do echo -n "imageDigest=$$image "; done) # aws ecr-public batch-delete-image --repository-name $(REPOSITORY) --region $(REGION) --image-ids $$(for image in $$(aws ecr-public describe-images --repository-name $(REPOSITORY) --region $(REGION) --output json | jq -r '.imageDetails[] | select(.imageTags | not ).imageDigest'); do echo -n "imageDigest=$$image "; done)
scan: scan:
trivy $(TRIVY_OPTS) $(REPOSITORY):$(TAG) trivy $(TRIVY_OPTS) $(REPOSITORY):$(TAG)
test: test:
@echo "Not implemented (yet)" @echo "Not implemented (yet)"
pytest: pytest:
flake8 --ignore=E501 app/app.py flake8 --ignore=E501 app/app.py
./test.py ./test.py