forked from elastic/logstash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.sh
67 lines (57 loc) · 1.46 KB
/
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
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
#!/bin/bash
logstash=$PWD
contrib=$PWD/../logstash-contrib/
workdir="$PWD/build/release/"
mkdir -p $workdir
# circuit breaker to fail if there's something silly wrong.
if [ -z "$workdir" ] ; then
echo "workdir is empty?!"
exit 1
fi
if [ ! -d "$contrib" ] ; then
echo "Missing: $contrib"
echo "Maybe git clone it?"
exit 1
fi
set -e
prepare() {
rsync -a --delete $logstash/{bin,docs,lib,spec,Makefile,gembag.rb,logstash.gemspec,tools,locales,patterns,LICENSE,README.md} $contrib/{lib,spec} $workdir
rm -f $logstash/.VERSION.mk
make -C $logstash .VERSION.mk
make -C $logstash tarball package
make -C $contrib tarball package
cp $logstash/.VERSION.mk $workdir
rm -f $workdir/build/pkg
rm -f $workdir/build/*.{zip,rpm,gz,deb} || true
}
docs() {
make -C $workdir build
(cd $contrib; find lib/logstash -type f -name '*.rb') > $workdir/build/contrib_plugins
make -C $workdir -j 4 docs
}
tests() {
make -C $logstash test QUIET=
make -C $logstash tarball test QUIET=
}
packages() {
for path in $logstash $contrib ; do
rm -f $path/build/*.tar.gz
rm -f $path/build/*.zip
echo "Building packages: $path"
make -C $path tarball
for dir in build pkg . ; do
[ ! -d "$path/$dir" ] && continue
(cd $path/$dir;
for i in *.gz *.rpm *.deb *.zip *.jar ; do
[ ! -f "$i" ] && continue
echo "Copying $path/$dir/$i"
cp $i $workdir/build
done
)
done
done
}
prepare
tests
docs
packages