CI: provide makefile for CI and fixe types.Event (#70)

This commit is contained in:
Thibault "bui" Koechlin 2020-06-11 15:03:43 +02:00 committed by GitHub
parent e3525f970b
commit 26f77bed88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 2 deletions

View file

@ -39,6 +39,18 @@ goversion:
CURRENT_GOVERSION="$(shell go version | cut -d " " -f3 | sed -r 's/[go]+//g')"
RESPECT_VERSION="$(shell echo "$(CURRENT_GOVERSION),$(REQUIRE_GOVERSION)" | tr ',' '\n' | sort -V)"
hubci:
@rm -rf crowdsec-xxx hub-tests
BUILD_VERSION=xxx make release
@git clone https://github.com/crowdsecurity/hub-tests.git
@cd hub-tests && make
@cd crowdsec-xxx && ./test_env.sh
@cd crowdsec-xxx/tests && bash ../../scripts/install_all.sh
@cp hub-tests/main ./crowdsec-xxx/tests/
@cp -R hub-tests/tests ./crowdsec-xxx/tests/
@cd ./crowdsec-xxx/tests/ && bash ../../hub-tests/run_tests.sh
clean:
@make -C $(CROWDSEC_FOLDER) clean --no-print-directory
@make -C $(CSCLI_FOLDER) clean --no-print-directory

View file

@ -19,9 +19,9 @@ type Event struct {
/* the current stage of the line being parsed */
Stage string `yaml:"Stage,omitempty"`
/* original line (produced by acquisition) */
Line Line `json:"-" yaml:"Line,omitempty"`
Line Line `json:"Line" yaml:"Line,omitempty"`
/* output of groks */
Parsed map[string]string `json:"-" yaml:"Parsed,omitempty"`
Parsed map[string]string `json:"Parsed,omitempty" yaml:"Parsed,omitempty"`
/* output of enrichment */
Enriched map[string]string `json:"Enriched,omitempty" yaml:"Enriched,omitempty"`
/* Overflow */

7
scripts/install_all.sh Normal file
View file

@ -0,0 +1,7 @@
#!/bin/sh
./cscli -c dev.yaml list parsers -a -o json | jq -r ".[].name" > installed_parsers.txt
cat installed_parsers.txt | while read parser; do
echo "install ${parser}" ;
./cscli -c dev.yaml install parser ${parser} ;
done