mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 12:25:53 +02:00
reduce log verbosity, minor CI fixes, lint (#3157)
* pkg/cwhub: redundant log messages * CI: fixture output and elapsed time * CI: preload only essential hub items * report full version (including -rc2 etc.) with cscli hub update --debug * lint
This commit is contained in:
parent
6f5d75c5f1
commit
136dba61d9
19 changed files with 119 additions and 100 deletions
|
@ -11,6 +11,8 @@ THIS_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
|||
|
||||
echo "Pre-downloading Hub content..."
|
||||
|
||||
start=$(date +%s%N)
|
||||
|
||||
types=$("$CSCLI" hub types -o raw)
|
||||
|
||||
for itemtype in $types; do
|
||||
|
@ -19,9 +21,12 @@ for itemtype in $types; do
|
|||
#shellcheck disable=SC2086
|
||||
"$CSCLI" "$itemtype" install \
|
||||
$ALL_ITEMS \
|
||||
--download-only \
|
||||
--error
|
||||
--download-only
|
||||
fi
|
||||
done
|
||||
|
||||
echo " done."
|
||||
elapsed=$((($(date +%s%N) - start)/1000000))
|
||||
# bash only does integer arithmetic, we could use bc or have some fun with sed
|
||||
elapsed=$(echo "$elapsed" | sed -e 's/...$/.&/;t' -e 's/.$/.0&/')
|
||||
|
||||
echo " done in $elapsed secs."
|
||||
|
|
|
@ -70,7 +70,9 @@ make_init_data() {
|
|||
./instance-db config-yaml
|
||||
./instance-db setup
|
||||
|
||||
./bin/preload-hub-items
|
||||
# preload some content and data files
|
||||
"$CSCLI" collections install crowdsecurity/linux --download-only
|
||||
# sub-items did not respect --download-only
|
||||
./bin/remove-all-hub-items
|
||||
|
||||
# when installed packages are always using sqlite, so no need to regenerate
|
||||
|
|
|
@ -116,7 +116,10 @@ make_init_data() {
|
|||
|
||||
"$CSCLI" --warning hub update
|
||||
|
||||
./bin/preload-hub-items
|
||||
# preload some content and data files
|
||||
"$CSCLI" collections install crowdsecurity/linux --download-only
|
||||
# sub-items did not respect --download-only
|
||||
./bin/remove-all-hub-items
|
||||
|
||||
# force TCP, the default would be unix socket
|
||||
"$CSCLI" --warning machines add githubciXXXXXXXXXXXXXXXXXXXXXXXX --url http://127.0.0.1:8080 --auto --force
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue