Update 4 files
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 40s
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 40s
This commit is contained in:
@@ -39,6 +39,23 @@ echo "Generating Filebeat configuration..."
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
bash "$SCRIPT_DIR/scripts/generate-config.sh" || _die "Failed to generate configuration"
|
||||
|
||||
# Create Docker volumes
|
||||
CONFIG_VOLUME="${CONFIG_VOLUME:-${CONTAINER_NAME}_config}"
|
||||
DATA_VOLUME="${DATA_VOLUME:-${CONTAINER_NAME}_data}"
|
||||
CERTS_VOLUME="${CERTS_VOLUME:-${CONTAINER_NAME}_certs}"
|
||||
|
||||
echo "Creating Docker volumes..."
|
||||
docker volume create "$CONFIG_VOLUME" >/dev/null 2>&1 || true
|
||||
docker volume create "$DATA_VOLUME" >/dev/null 2>&1 || true
|
||||
docker volume create "$CERTS_VOLUME" >/dev/null 2>&1 || true
|
||||
|
||||
# Copy config to volume
|
||||
if [ -f "${CONFIG_PATH}/filebeat.yml" ]; then
|
||||
echo "Copying configuration to Docker volume..."
|
||||
docker run --rm -v "${CONFIG_VOLUME}:/config" -v "${CONFIG_PATH}:/source:ro" alpine \
|
||||
cp /source/filebeat.yml /config/filebeat.yml
|
||||
fi
|
||||
|
||||
# Start the new container
|
||||
bash ./start.sh || _die "Failed to start Filebeat"
|
||||
|
||||
|
@@ -3,7 +3,14 @@
|
||||
# Generate Filebeat configuration from template
|
||||
# This script creates a filebeat.yml configuration file with proper authentication
|
||||
|
||||
CONFIG_DIR="${CONFIG_VOLUME:-${CONFIG_PATH:-./config}}"
|
||||
# Determine config directory - use CONFIG_PATH from dropshell or fallback
|
||||
if [ -n "$CONFIG_PATH" ]; then
|
||||
CONFIG_DIR="$CONFIG_PATH"
|
||||
elif [ -d "./config" ]; then
|
||||
CONFIG_DIR="./config"
|
||||
else
|
||||
CONFIG_DIR="."
|
||||
fi
|
||||
|
||||
# Ensure config directory exists
|
||||
mkdir -p "$CONFIG_DIR"
|
||||
|
@@ -2,6 +2,11 @@
|
||||
source "${AGENT_PATH}/common.sh"
|
||||
_check_required_env_vars "CONTAINER_NAME" "IMAGE_REGISTRY" "IMAGE_REPO" "IMAGE_TAG"
|
||||
|
||||
# Define volume names if not set
|
||||
CONFIG_VOLUME="${CONFIG_VOLUME:-${CONTAINER_NAME}_config}"
|
||||
DATA_VOLUME="${DATA_VOLUME:-${CONTAINER_NAME}_data}"
|
||||
CERTS_VOLUME="${CERTS_VOLUME:-${CONTAINER_NAME}_certs}"
|
||||
|
||||
# Create Docker command
|
||||
cmd="docker run -d \
|
||||
--name $CONTAINER_NAME \
|
||||
|
Reference in New Issue
Block a user