-
Notifications
You must be signed in to change notification settings - Fork 95
/
Copy pathMakefile
59 lines (48 loc) · 1.29 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!make
DOCKER?=docker
DOCKER_BUILD_FLAGS?=
DOCKER_REGISTRY?=docker.io
DOCKER_TAG?=2.30.0
GIT?=git
PY3?=python3
DATE=$(shell date +%s)
TMP_GIT=tmp-$(shell date +%s)
define HELP_MENU
Usage: make [<env>] <target> [<target> ...]
Main targets:
all (default) call the default target(s)
build build the Docker image
clean remove all default artifacts
help show this help
save save the Docker image to an archive
rulesets update default rulesets (files will be created in current directory)
Refer to the documentation for use cases and examples.
endef
.PHONY: all build clean help save
all: clean
build:
ifndef DOCKER
$(error Docker (https://docs.docker.com/install/) is required. Please install it first)
endif
$(DOCKER) image build \
--rm \
--tag $(DOCKER_REGISTRY)/wagga40/zircolite:$(DOCKER_TAG) \
$(DOCKER_BUILD_FLAGS) \
.
help:
$(info $(HELP_MENU))
clean:
rm -rf "detected_events.json"
rm -rf ./tmp-*
rm -f zircolite.log
rm -f fields.json
rm -f zircolite.tar
save:
ifndef DOCKER
$(error Docker (https://docs.docker.com/install/) is required. Please install it first)
endif
$(DOCKER) image save \
--output zircolite.tar \
$(DOCKER_REGISTRY)/wagga40/zircolite:$(DOCKER_TAG)
rulesets:
$(info Please check docs to generate rulesets)