-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrelease.sh
executable file
·40 lines (34 loc) · 887 Bytes
/
release.sh
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
# App Plugin packager for Kibana 5.x and higher
#
# Usage:
# VERSION="6.2.2" ./release.sh
#
APPDIR=$(pwd)
APP=$(sed -n 's/.*"name": "\(.*\)",/\1/p' package.json)
if [ -z $VERSION ]; then
OVERRIDE="false"
VERSION=$(sed -n 's/.*"version": "\(.*\)",/\1/p' package.json)
fi
echo "$APP plugin packager for Kibana $VERSION";
# Temp Directory
cd $(mktemp -d)
TEMPDIR=$(pwd)
mkdir -p $TEMPDIR/kibana/$APP
# Build Plugin
cp -r $APPDIR/* $TEMPDIR/kibana/$APP/
cd $TEMPDIR/kibana/$APP
if [ -z $OVERRIDE ]; then
echo "Patching with version $VERSION ... "
sed -Ei "s/(\"version\":).*$/\1 \"$VERSION\"/" package.json
fi
npm install --production
cd $TEMPDIR
# Create Archive
zip -r $APP-$VERSION.zip ./kibana -x *gulp* -x *.zip
mv $APP-$VERSION.zip $APPDIR/
cd $APPDIR
# Clean up!
rm -rf $TEMPDIR
ls -alF $APP-$VERSION.zip
echo "Done! Archive $APP-$VERSION.zip ready."