-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
42 lines (34 loc) · 1.13 KB
/
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
GOSS_VERSION := 0.3.6
caps := $(shell ls caps | sed -e 's/.yml//')
IMAGE = chussenot/event-generator
.PHONY: help
.DEFAULT_GOAL := test
help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
@make list
# https://github.com/aelsabbahy/goss#installation
bin/goss:
@mkdir -p bin
@curl -o bin/goss -L \
https://github.com/aelsabbahy/goss/releases/download/v${GOSS_VERSION}/goss-linux-amd64
@chmod +x bin/goss
test: bin/goss build-event-generator-image run-event-generator ## Run all the tests
@make ${caps}
$(caps): %: build-event-generator-image ## Dynamic tasks
@echo "Start test for $*"
@docker run --rm -t \
-v `pwd`/bin/goss:/usr/local/bin/goss \
-v `pwd`/caps:/goss \
-v `pwd`/tests:/goss/tests \
-w /goss \
--cap-drop $* \
$(IMAGE) \
goss -g $*.yml \
validate --max-concurrent 5 \
--format documentation
list: ## List existing scenarii.
@echo ${caps}
build-event-generator-image:
@docker build -t $(IMAGE):latest docker/event-generator
run-event-generator: ## Run the falco event generator
@docker-compose -f event-generator.yml up --remove-orphans