This repository has been archived by the owner on Jan 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.sh
executable file
·113 lines (93 loc) · 2.91 KB
/
build.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/bin/sh
basedir=`pwd`
# centos or debian
os=$1
# your name
maintainer=$2
echo "Building Kibana package for $os with maintainer '$maintainer'"
if [[ $os == "centos" ]]; then
# Create required directories
mkdir -p $basedir/build_root_centos/usr/local
mkdir -p $basedir/build_root_centos/etc/rc.d/init.d
mkdir -p $basedir/build_root_centos/etc/sysconfig
# Fetch the latest code, build the libraries and
# remove files we don't need
cd $basedir/build_root_centos/usr/local
git clone https://github.com/rashidkpc/Kibana.git ./kibana
cd kibana
bundle install --deployment
rm -rf .git .travis.yml .gitignore
# Copy the init file and make it executable
cd $basedir/build_root_centos/etc/rc.d/init.d
cp $basedir/kibana.init.centos ./kibana
chmod a+rx kibana
# Copy the default file
cd $basedir/build_root_centos/etc/sysconfig
cp $basedir/kibana.sysconfig.centos ./kibana
# Ensure everythign has the correct settings
cd $basedir/build_root_centos
find . -type d -exec chmod a+rx {} \;
find . -type f -exec chmod a+r {} \;
# Lets build the package
cd $basedir
fpm -s dir \
-t rpm \
-n kibana \
-v 0.2.0 \
--iteration '1.el6' \
--license MIT \
--category 'System Environment/Daemons' \
-a 'noarch' \
--description 'Kibana is a web interface for Logstash.' \
--url 'http://kibana.org' \
--vendor 'Kibana.Org' \
--maintainer "$maintainer" \
-d 'ruby' \
--rpm-user 'root' \
--rpm-group 'root' \
-C build_root_centos .
# Clean up the build directory
rm -rf $basedir/build_root_centos
elif [[ $os == "debian" ]]; then
# Create required directories
mkdir -p $basedir/build_root_debian/usr/local
mkdir -p $basedir/build_root_debian/etc/init.d
mkdir -p $basedir/build_root_debian/etc/default
# Fetch the latest code, build the libraries and
# remove files we don't need
cd $basedir/build_root_debian/usr/local
git clone git://github.com/rashidkpc/Kibana.git ./kibana
cd kibana
bundle install --deployment
rm -rf .git .travis.yml .gitignore
# Copy the init file and make it executable
cd $basedir/build_root_debian/etc/init.d
cp $basedir/kibana.init.debian ./kibana
chmod a+rx kibana
# Copy the default file
cd $basedir/build_root_debian/etc/default
cp $basedir/kibana.default.debian ./kibana
# Ensure everythign has the correct settings
cd $basedir/build_root_debian
find . -type d -exec chmod a+rx {} \;
find . -type f -exec chmod a+r {} \;
# Lets build the package
cd $basedir
fpm -s dir \
-t deb \
-n kibana \
-v 0.2.0 \
--iteration '1' \
--license MIT \
-a 'all' \
--description 'Kibana is a web interface for Logstash.' \
--url 'http://kibana.org' \
--vendor 'Kibana.Org' \
--maintainer "$maintainer" \
-d 'ruby' \
--deb-user 'root' \
--deb-group 'root' \
-C build_root_debian .
# Clean up the build directory
rm -rf $basedir/build_root_debian
fi