add build and test scripts

This commit is contained in:
Timofey Turenko
2017-05-17 19:18:20 +03:00
committed by Markus Mäkelä
parent 82f18d1c7e
commit fb439e0f4a
3 changed files with 160 additions and 0 deletions

70
BUILD/build_rpm_local.sh Executable file
View File

@ -0,0 +1,70 @@
#!/bin/bash
# do the real building work
# this script is executed on build VM
set -x
cd ./MaxScale
mkdir _build
cd _build
cmake .. $cmake_flags
make
if [ $remove_strip == "yes" ] ; then
sudo rm -rf /usr/bin/strip
sudo touch /usr/bin/strip
sudo chmod a+x /usr/bin/strip
fi
sudo make package
res=$?
if [ $res != 0 ] ; then
echo "Make package failed"
exit $res
fi
sudo rm ../CMakeCache.txt
sudo rm CMakeCache.txt
echo "Building tarball..."
cmake .. $cmake_flags -DTARBALL=Y
sudo make package
cd ..
cp _build/*.rpm .
cp _build/*.gz .
if [ "$build_experimental" == "yes" ] ; then
sudo rm -rf _build
mkdir _build
cd _build
cmake .. $cmake_flags -DTARGET_COMPONENT=experimental
sudo make package
cd ..
cp _build/*.rpm .
cp _build/*.gz .
sudo rm -rf _build
mkdir _build
cd _build
cmake .. $cmake_flags -DTARGET_COMPONENT=devel
sudo make package
cd ..
cp _build/*.rpm .
cp _build/*.gz .
fi
if [ "$BUILD_RABBITMQ" == "yes" ] ; then
cmake ../rabbitmq_consumer/ $cmake_flags
sudo make package
res=$?
if [ $res != 0 ] ; then
exit $res
fi
cd ..
cp _build/*.rpm .
cp _build/*.gz .
fi
sudo rpm -i maxscale*.rpm