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:
mmetc 2024-08-01 10:55:04 +02:00 committed by GitHub
parent 6f5d75c5f1
commit 136dba61d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 119 additions and 100 deletions

View file

@ -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."

View file

@ -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

View file

@ -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