-
Notifications
You must be signed in to change notification settings - Fork 3
/
compile
executable file
·39 lines (27 loc) · 972 Bytes
/
compile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
BUILD_DIR=$1
indent() {
sed 's/^/ /'
}
LOGSTASH_VERSION=${LOGSTASH_VERSION:-6.8.21}
BUILDPACK_PATH=$(dirname $(readlink -f $0))/../
echo "Downloading Logstash version $LOGSTASH_VERSION" | indent
if [ ${LOGSTASH_VERSION:0:1} = "6" ]
then
URL=https://artifacts.elastic.co/downloads/logstash/logstash-$LOGSTASH_VERSION.tar.gz
else
URL=https://artifacts.elastic.co/downloads/logstash/logstash-$LOGSTASH_VERSION-linux-x86_64.tar.gz
fi
curl $URL -L --silent -o /tmp/logstash.tar.gz
echo "Extracting logstash" | indent
mkdir -p $BUILD_DIR/logstash
tar -xf /tmp/logstash.tar.gz -C $BUILD_DIR/logstash
echo "Installing plugins" | indent
cd $BUILD_DIR/logstash/logstash-$LOGSTASH_VERSION
for plugin in $(echo $LOGSTASH_PLUGINS | sed "s/,/ /g") ; do
echo "Installing plugin $plugin" | indent
bin/logstash-plugin install $plugin | indent
done
mkdir -p $BUILD_DIR/bin
cp $BUILDPACK_PATH/bin/logstash $BUILD_DIR/bin/logstash
echo "Done" | indent