swtich from ELK to Loki!
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:
@@ -1,36 +1,6 @@
|
||||
#!/bin/bash
|
||||
source "${AGENT_PATH}/common.sh"
|
||||
_check_required_env_vars "CONTAINER_NAME" "IMAGE_REGISTRY" "IMAGE_REPO" "IMAGE_TAG"
|
||||
_check_required_env_vars "CONTAINER_NAME"
|
||||
|
||||
# Check that config file exists
|
||||
if [ ! -f "${CONFIG_PATH}/filebeat.yml" ]; then
|
||||
_die "filebeat.yml not found in ${CONFIG_PATH}/filebeat.yml"
|
||||
fi
|
||||
|
||||
# Create Docker command
|
||||
DOCKER_RUN_CMD="docker run -d \
|
||||
--name $CONTAINER_NAME \
|
||||
--restart unless-stopped \
|
||||
--user root \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock:ro \
|
||||
-v /var/log:/var/log:ro \
|
||||
-v ${CONFIG_PATH}:/usr/share/filebeat/config:ro \
|
||||
-v ${DATA_VOLUME}:/usr/share/filebeat/data \
|
||||
-e LOGSERVER_HOST=${LOGSERVER_HOST} \
|
||||
-e LOGSERVER_PORT=${LOGSERVER_PORT} \
|
||||
-e API_KEY=${API_KEY} \
|
||||
-e HOSTNAME=$(hostname) \
|
||||
$IMAGE_REGISTRY/$IMAGE_REPO:$IMAGE_TAG \
|
||||
filebeat -e -strict.perms=false \
|
||||
-c /usr/share/filebeat/config/filebeat.yml"
|
||||
|
||||
if ! _create_and_start_container "$DOCKER_RUN_CMD" "$CONTAINER_NAME"; then
|
||||
_die "Failed to start container ${CONTAINER_NAME}"
|
||||
fi
|
||||
|
||||
# Check if the container is running
|
||||
if ! _is_container_running "$CONTAINER_NAME"; then
|
||||
_die "Container ${CONTAINER_NAME} is not running"
|
||||
fi
|
||||
|
||||
echo "Container ${CONTAINER_NAME} started"
|
||||
docker compose up -d || _die "Failed to start"
|
||||
echo "Log Client started"
|
Reference in New Issue
Block a user