logstash/tools/release.sh
Colin Surprenant 0d3df38cb9 logstash boot sequence cleanup & drip support fix
deprecated USE_JRUBY environment var
added USE_RUBY and USE_DRIP environment vars
centralized gem path handling in LogStash::Environment

use consistent discovery strategy
2014-07-13 20:02:42 -04:00

67 lines
1.5 KiB
Bash

#!/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