forked from kubev2v/forklift-validation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (25 loc) · 657 Bytes
/
Makefile
File metadata and controls
30 lines (25 loc) · 657 Bytes
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
28
29
30
IMAGE_REGISTRY ?= quay.io
IMAGE_ORG ?= konveyor
IMAGE_REPO ?= forklift-validation
IMAGE_TAG ?= latest
IMAGE_FQIN ?= ${IMAGE_REGISTRY}/${IMAGE_ORG}/${IMAGE_REPO}:${IMAGE_TAG}
all: test
test: opa-bin
ENVIRONMENT=test ${OPA} test policies --explain fails
docker-build:
docker build -t ${IMAGE_FQIN} .
docker-push:
docker push ${IMAGE_FQIN}
# Find or download opa
opa-bin:
ifeq (, $(shell which opa))
@{ \
set -e ;\
mkdir -p ${HOME}/.local/bin ; \
curl -sL -o ${HOME}/.local/bin/opa https://openpolicyagent.org/downloads/latest/opa_linux_amd64 ; \
chmod 755 ${HOME}/.local/bin/opa ;\
}
OPA=${HOME}/.local/bin/opa
else
OPA=$(shell which opa)
endif