-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
53 lines (40 loc) · 1.3 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
-include .env
CONTAINER := gn-fluentbit
WORKDIR := /app
.docker-build: build
@touch .docker-build
.PHONY: build
build:
docker build -t $(CONTAINER) .
.PHONY: push
push: .docker-build
docker login -u $(USERNAME_PASSWORD) -p $(DOCKERHUB_PASSWORD)
docker tag $(CONTAINER) greynoise/greynoise-fluentbit-lua:$(TAG)
docker push greynoise/greynoise-fluentbit-lua:$(TAG)
.PHONY: clean
clean:
@rm -rf .docker-build output/*
.PHONY: shell
shell: .docker-build
docker run -it --entrypoint /bin/bash -v $(PWD):$(WORKDIR) $(CONTAINER)
.PHONY: run-tail
run-tail: clean .docker-build
docker run --env-file .env -it -p 2020:2020 -v $(PWD):$(WORKDIR) $(CONTAINER) -c /app/conf/tail.conf
.PHONY: run-rewrite
run-rewrite: clean .docker-build
docker run --env-file .env -it -p 2020:2020 -v $(PWD):$(WORKDIR) $(CONTAINER) -c /app/conf/rewrite.conf
.PHONY: run
run: clean .docker-build
docker run --env-file .env -it -p 2020:2020 -v $(PWD):$(WORKDIR) $(CONTAINER) -c /app/conf/dummy.conf
.PHONY: test
test: clean .docker-build
docker run --env-file .env_example --entrypoint /usr/local/bin/busted -v $(PWD):$(WORKDIR) $(CONTAINER) -C /opt/greynoise spec/test.lua
.PHONY: lint
lint:
luacheck -d greynoise/**/*.lua
.PHONY: format
format:
lua-format -i -c .lua-format greynoise/**/*.lua
.PHONY: stats
stats:
./scripts/stats.sh