Skip to content

Commit e144427

Browse files
committed
Merge branch 'release/0.13.0'
2 parents a4cd428 + a5efc0c commit e144427

File tree

8 files changed

+89
-11
lines changed

8 files changed

+89
-11
lines changed

1.4/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
NAME = pblittle/docker-logstash
2-
VERSION = 0.12.1
2+
VERSION = 0.13.0
33

44
# Set the LOGSTASH_CONFIG_URL env var to your logstash.conf file.
55
# We will use our basic config if the value is empty.

1.4/base/bin/boot

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function main() {
3535

3636
# Fire up logstash!
3737
#
38-
logstash_start_agent
38+
logstash_start_agent "$@"
3939
}
4040

4141
main "$@"

1.4/base/logstash.sh

+34-6
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,41 @@ function logstash_create_log_dir() {
7272
}
7373

7474
function logstash_start_agent() {
75+
local binary="$LOGSTASH_BINARY"
7576
local config_dir="$LOGSTASH_CONFIG_DIR"
7677
local log_file="$LOGSTASH_LOG_FILE"
7778

78-
exec "$LOGSTASH_BINARY" \
79-
agent \
80-
--config "$config_dir" \
81-
--log "$log_file" \
82-
-- \
83-
web
79+
case "$1" in
80+
# run just the agent
81+
'agent')
82+
exec "$binary" \
83+
agent \
84+
--config "$config_dir" \
85+
--log "$log_file" \
86+
--
87+
;;
88+
# test the logstash configuration
89+
'configtest')
90+
exec "$binary" \
91+
agent \
92+
--config "$config_dir" \
93+
--log "$log_file" \
94+
--configtest \
95+
--
96+
;;
97+
# run just the web
98+
'web')
99+
exec "$binary" \
100+
web
101+
;;
102+
# run agent+web (default operation)
103+
*)
104+
exec "$binary" \
105+
agent \
106+
--config "$config_dir" \
107+
--log "$log_file" \
108+
-- \
109+
web
110+
;;
111+
esac
84112
}

1.4/test/Makefile

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
NAME = pblittle/docker-logstash-test
2-
VERSION = 0.12.1
2+
VERSION = 0.13.0
33

44
BUILD_SRC = ${CURDIR}/../base
55

@@ -29,3 +29,12 @@ test-elasticsearch-linked: build
2929
fig rm && \
3030
fig build && \
3131
fig up
32+
33+
.PHONY: test-logstash-configtest
34+
test-logstash-configtest: build
35+
36+
cd ${CURDIR}/logstash-configtest && \
37+
fig stop && \
38+
fig rm && \
39+
fig build && \
40+
fig up

1.4/test/elasticsearch-embedded/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM pblittle/docker-logstash:0.12.1
1+
FROM pblittle/docker-logstash:0.13.0
22
MAINTAINER P. Barrett Little <barrett@barrettlittle.com> (@pblittle)
33

44
# Download packages required to run the test suite

1.4/test/elasticsearch-linked/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM pblittle/docker-logstash:0.12.1
1+
FROM pblittle/docker-logstash:0.13.0
22
MAINTAINER P. Barrett Little <barrett@barrettlittle.com> (@pblittle)
33

44
# Download packages required to run the test suite
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM pblittle/docker-logstash:0.13.0
2+
MAINTAINER P. Barrett Little <barrett@barrettlittle.com> (@pblittle)
3+
4+
# Download packages required to run the test suite
5+
#
6+
RUN apt-get update \
7+
&& apt-get install -yq \
8+
apt-utils \
9+
git \
10+
net-tools \
11+
telnet \
12+
--no-install-recommends \
13+
&& rm -rf /var/cache/apt/* \
14+
&& rm -rf /var/lib/apt/lists/*
15+
16+
# Download and install BATS test framework
17+
#
18+
RUN git clone https://github.com/sstephenson/bats.git /tmp/bats \
19+
&& /tmp/bats/install.sh /usr/local \
20+
&& rm -rf /tmp/bats
21+
22+
# $TERM needs to be set for bats
23+
#
24+
ENV TERM xterm-256color
25+
26+
WORKDIR /app
27+
ADD test.bats /app/test.bats
28+
29+
CMD []

1.4/test/logstash-configtest/fig.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
elasticsearch:
3+
image: dockerfile/elasticsearch
4+
ports:
5+
- '9200:9200'
6+
- '9300:9300'
7+
command: '/elasticsearch/bin/elasticsearch -Des.http.cors.enabled=true'
8+
9+
logstash:
10+
build: .
11+
environment:
12+
LOGSTASH_TRACE: true

0 commit comments

Comments
 (0)