Set cpu cores number to build VM and separate build and upgrade

VM should have 8 cores to make build faster in GCloud.
To get rid of ssfs between build hosts the build step
and upgrade test step are separated as well as
repository discriåtion generation
This commit is contained in:
Timofey Turenko 2020-03-11 18:50:53 +02:00
parent e0cd6adb26
commit 8b2c46991b
6 changed files with 15 additions and 17 deletions

View File

@ -7,6 +7,7 @@ set -x
cd ./MaxScale
NCPU=$(grep -c processor /proc/cpuinfo)
mkdir _build
cd _build
@ -23,7 +24,7 @@ then
fi
export LD_LIBRARY_PATH=$(for i in `find $PWD/ -name '*.so*'`; do echo $(dirname $i); done|sort|uniq|xargs|sed -e 's/[[:space:]]/:/g')
make package
make -j${NCPU} package
res=$?
if [ $res != 0 ] ; then
echo "Make package failed"
@ -35,7 +36,7 @@ sudo rm CMakeCache.txt
echo "Building tarball..."
cmake .. $cmake_flags -DTARBALL=Y
sudo make package
sudo make -j${NCPU} package
cp _CPack_Packages/Linux/DEB/*.deb ../
@ -57,7 +58,7 @@ then
export LD_LIBRARY_PATH=""
cmake .. $cmake_flags -DTARGET_COMPONENT=$component
export LD_LIBRARY_PATH=$(for i in `find $PWD/ -name '*.so*'`; do echo $(dirname $i); done|sort|uniq|xargs|sed -e 's/[[:space:]]/:/g')
make package
make -j${NCPU} package
cp _CPack_Packages/Linux/DEB/*.deb ../
cd ..
cp _build/*.deb .
@ -68,7 +69,7 @@ fi
if [ "$BUILD_RABBITMQ" == "yes" ] ; then
cmake ../rabbitmq_consumer/ $cmake_flags
sudo make package
sudo make -j${NCPU} package
res=$?
if [ $res != 0 ] ; then
exit $res

View File

@ -7,10 +7,12 @@ set -x
cd ./MaxScale
NCPU=$(grep -c processor /proc/cpuinfo)
mkdir _build
cd _build
cmake .. $cmake_flags
make || exit 1
make -j${NCPU} || exit 1
if [[ "$cmake_flags" =~ "BUILD_TESTS=Y" ]]
then
@ -24,7 +26,7 @@ then
if [ $? -eq 0 ]
then
export SKIP_SHUTDOWN=Y
make test_rest_api && make test_maxctrl
make -j${NCPU} test_rest_api && make -j${NCPU} test_maxctrl
rc=$?
#docker ps -aq|xargs docker rm -vf
@ -41,7 +43,7 @@ sudo rm -rf /usr/bin/strip
sudo touch /usr/bin/strip
sudo chmod a+x /usr/bin/strip
sudo make package
sudo make -j${NCPU} package
res=$?
if [ $res != 0 ] ; then
echo "Make package failed"
@ -53,7 +55,7 @@ sudo rm CMakeCache.txt
echo "Building tarball..."
cmake .. $cmake_flags -DTARBALL=Y
sudo make package
sudo make -j${NCPU} package
cd ..
cp _build/*.rpm .
@ -66,7 +68,7 @@ then
cd _build
rm CMakeCache.txt
cmake .. $cmake_flags -DTARGET_COMPONENT=$component
sudo make package
sudo make -j${NCPU} package
cd ..
cp _build/*.rpm .
cp _build/*.gz .
@ -75,7 +77,7 @@ fi
if [ "$BUILD_RABBITMQ" == "yes" ] ; then
cmake ../rabbitmq_consumer/ $cmake_flags
sudo make package
sudo make -j${NCPU} package
res=$?
if [ $res != 0 ] ; then
exit $res

View File

@ -147,6 +147,7 @@ then
# We need zypper here
sudo zypper -n refresh
sudo zypper -n update
sudo zypper -n remove gettext-runtime-mini
sudo zypper -n install gcc gcc-c++ ncurses-devel bison glibc-devel libgcc_s1 perl \
make libtool libopenssl-devel libaio libaio-devel flex \
pcre-devel git wget tcl tcl-devel libuuid-devel \

View File

@ -119,8 +119,3 @@ if [ $build_result -ne 0 ] ; then
echo "Build FAILED!"
exit $build_result
fi
if [ ${run_upgrade_test} == "yes" ] ; then
${script_dir}/upgrade_test.sh
fi

View File

@ -69,5 +69,3 @@ cd $dir
echo "cleaning ${unsorted_repo_dir}/$target/$box"
rm -rf ${unsorted_repo_dir}/$target/$box
${mdbci_dir}/mdbci generate-product-repositories --product maxscale_ci --product-version $target

View File

@ -3,6 +3,7 @@
{
"hostname" : "default",
"memory_size" : "4096",
"cpu_count" : "8",
"box" : "$box",
"product" : {
"name": "docker"