Skip to content

Commit 26f77be

Browse files
authored
CI: provide makefile for CI and fixe types.Event (#70)
1 parent e3525f9 commit 26f77be

3 files changed

Lines changed: 21 additions & 2 deletions

File tree

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ goversion:
3939
CURRENT_GOVERSION="$(shell go version | cut -d " " -f3 | sed -r 's/[go]+//g')"
4040
RESPECT_VERSION="$(shell echo "$(CURRENT_GOVERSION),$(REQUIRE_GOVERSION)" | tr ',' '\n' | sort -V)"
4141

42+
43+
hubci:
44+
@rm -rf crowdsec-xxx hub-tests
45+
BUILD_VERSION=xxx make release
46+
@git clone https://github.com/crowdsecurity/hub-tests.git
47+
@cd hub-tests && make
48+
@cd crowdsec-xxx && ./test_env.sh
49+
@cd crowdsec-xxx/tests && bash ../../scripts/install_all.sh
50+
@cp hub-tests/main ./crowdsec-xxx/tests/
51+
@cp -R hub-tests/tests ./crowdsec-xxx/tests/
52+
@cd ./crowdsec-xxx/tests/ && bash ../../hub-tests/run_tests.sh
53+
4254
clean:
4355
@make -C $(CROWDSEC_FOLDER) clean --no-print-directory
4456
@make -C $(CSCLI_FOLDER) clean --no-print-directory

pkg/types/event.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ type Event struct {
1919
/* the current stage of the line being parsed */
2020
Stage string `yaml:"Stage,omitempty"`
2121
/* original line (produced by acquisition) */
22-
Line Line `json:"-" yaml:"Line,omitempty"`
22+
Line Line `json:"Line" yaml:"Line,omitempty"`
2323
/* output of groks */
24-
Parsed map[string]string `json:"-" yaml:"Parsed,omitempty"`
24+
Parsed map[string]string `json:"Parsed,omitempty" yaml:"Parsed,omitempty"`
2525
/* output of enrichment */
2626
Enriched map[string]string `json:"Enriched,omitempty" yaml:"Enriched,omitempty"`
2727
/* Overflow */

scripts/install_all.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
3+
./cscli -c dev.yaml list parsers -a -o json | jq -r ".[].name" > installed_parsers.txt
4+
cat installed_parsers.txt | while read parser; do
5+
echo "install ${parser}" ;
6+
./cscli -c dev.yaml install parser ${parser} ;
7+
done

0 commit comments

Comments
 (0)