generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
27 lines (21 loc) · 820 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
.PHONY: test build run scan ct
IMAGE_NAME ?= ghcr.io/ministryofjustice/analytical-platform-mlflow
IMAGE_TAG ?= local
ct:
ct lint --charts chart
scan: build
trivy image --vuln-type os,library --severity CRITICAL --exit-code 1 $(IMAGE_NAME)
run: build
docker-compose --project-directory test --file test/docker-compose.yml up
test: build
container-structure-test test --platform linux/amd64 --config test/container-structure-test.yml --image $(IMAGE_NAME):$(IMAGE_TAG)
build:
@ARCH=`uname --machine`; \
case $$ARCH in \
aarch64 | arm64) \
echo "Building on $$ARCH architecture"; \
docker build --platform linux/amd64 --file Dockerfile --tag $(IMAGE_NAME):$(IMAGE_TAG) . ;; \
*) \
echo "Building on $$ARCH architecture"; \
docker build --file Dockerfile --tag $(IMAGE_NAME):$(IMAGE_TAG) . ;; \
esac