mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-10 20:05:55 +02:00
move plugins/notifications/* to cmd/notification-* (#2429)
This ensures keeping all dependencies in sync, and simplifies packaging under freebsd/gentoo/etc because there is a single vendor directory.
This commit is contained in:
parent
e36df40ba7
commit
2aa55e9444
52 changed files with 132 additions and 724 deletions
|
@ -9,7 +9,7 @@ function show_help() {
|
|||
Write-Output ".\test_env.ps1 -d tests #creates test env in .\tests"
|
||||
}
|
||||
|
||||
function create_arbo() {
|
||||
function create_tree() {
|
||||
$null = New-Item -ItemType Directory $data_dir
|
||||
$null = New-Item -ItemType Directory $log_dir
|
||||
$null = New-Item -ItemType Directory $config_dir
|
||||
|
@ -37,8 +37,8 @@ function copy_file() {
|
|||
#envsubst < "./config/dev.yaml" > $BASE/dev.yaml
|
||||
Copy-Item .\config\dev.yaml $base\dev.yaml
|
||||
$plugins | ForEach-Object {
|
||||
Copy-Item $plugins_dir\$notif_dir\$_\notification-$_.exe $base\$plugins_dir\notification-$_.exe
|
||||
Copy-Item $plugins_dir\$notif_dir\$_\$_.yaml $config_dir\$notif_dir\$_.yaml
|
||||
Copy-Item .\cmd\notification-$_\notification-$_.exe $base\$plugins_dir\notification-$_.exe
|
||||
Copy-Item .\cmd\notification-$_\$_.yaml $config_dir\$notif_dir\$_.yaml
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -76,9 +76,9 @@ $plugins_dir="plugins"
|
|||
$notif_dir="notifications"
|
||||
|
||||
|
||||
Write-Output "Creating test arbo in $base"
|
||||
create_arbo
|
||||
Write-Output "Arbo created"
|
||||
Write-Output "Creating test tree in $base"
|
||||
create_tree
|
||||
Write-Output "Tree created"
|
||||
Write-Output "Copying files"
|
||||
copy_file
|
||||
Write-Output "Files copied"
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
BASE="./tests"
|
||||
|
||||
usage() {
|
||||
echo "Usage:"
|
||||
echo " ./wizard.sh -h Display this help message."
|
||||
echo " ./test_env.sh -d ./tests Create test environment in './tests' folder"
|
||||
exit 0
|
||||
echo "Usage:"
|
||||
echo " $0 -h Display this help message."
|
||||
echo " $0 -d ./tests Create test environment in './tests' folder"
|
||||
exit 0
|
||||
}
|
||||
|
||||
|
||||
|
@ -24,7 +24,7 @@ do
|
|||
exit 0
|
||||
;;
|
||||
*) # unknown option
|
||||
log_err "Unknown argument ${key}."
|
||||
echo "Unknown argument ${key}." >&2
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
|
@ -57,7 +57,7 @@ log_info() {
|
|||
echo -e "[$date][INFO] $msg"
|
||||
}
|
||||
|
||||
create_arbo() {
|
||||
create_tree() {
|
||||
mkdir -p "$BASE"
|
||||
mkdir -p "$DATA_DIR"
|
||||
mkdir -p "$LOG_DIR"
|
||||
|
@ -86,8 +86,8 @@ copy_files() {
|
|||
envsubst < "./config/dev.yaml" > $BASE/dev.yaml
|
||||
for plugin in $PLUGINS
|
||||
do
|
||||
cp $PLUGINS_DIR/$NOTIF_DIR/$plugin/notification-$plugin $BASE/$PLUGINS_DIR/notification-$plugin
|
||||
cp $PLUGINS_DIR/$NOTIF_DIR/$plugin/$plugin.yaml $CONFIG_DIR/$NOTIF_DIR/$plugin.yaml
|
||||
cp cmd/notification-$plugin/notification-$plugin $BASE/$PLUGINS_DIR/notification-$plugin
|
||||
cp cmd/notification-$plugin/$plugin.yaml $CONFIG_DIR/$NOTIF_DIR/$plugin.yaml
|
||||
done
|
||||
}
|
||||
|
||||
|
@ -103,9 +103,9 @@ setup_api() {
|
|||
|
||||
|
||||
main() {
|
||||
log_info "Creating test arboresence in $BASE"
|
||||
create_arbo
|
||||
log_info "Arboresence created"
|
||||
log_info "Creating test tree in $BASE"
|
||||
create_tree
|
||||
log_info "Tree created"
|
||||
log_info "Copying needed files for tests environment"
|
||||
copy_files
|
||||
log_info "Files copied"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue