Commit 64f93c1a authored by Jan Möbius's avatar Jan Möbius

Try to Fix linux build pipeline

parent 890cbf57
#!/bin/bash
# Exit script on any error
set -e
#=====================================
# Color Settings:
#=====================================
NC='\033[0m'
OUTPUT='\033[0;32m'
WARNING='\033[0;93m'
echo -e "${OUTPUT}"
echo "=============================================================================="
echo "Running cppcheck"
echo "=============================================================================="
echo -e "${NC}"
echo "Started: $(date)"
echo "Please Wait ..."
# Run cppcheck and output into file
cppcheck --enable=all \
-j4 \
--quiet \
-i OpenFlipper/libs_required/OpenMesh \
-i OpenFlipper/libs_required/glew-cmake \
-i build-release \
-i build-debug \
-i .svn \
-i .git \
--force \
-UDOXY_IGNORE_THIS \
--suppress=unusedPrivateFunction \
--suppress=ConfigurationNotChecked \
--suppress=missingIncludeSystem \
-DOPENMESHDLLEXPORT="" \
-Umin -Umax -UBMPOSTFIX \
-DACGDLLEXPORT=""\
-DDLLEXPORTONLY=""\
-DDLLEXPORT=""\
. &> cppcheck.log
echo "Finished: $(date)"
echo -e "${OUTPUT}"
echo "=============================================================================="
echo "CPPCHECK Messages"
echo "=============================================================================="
echo -e "${NC}"
# Echo output to command line for simple analysis via gitlab
cat cppcheck.log
COUNT=$(wc -l < cppcheck.log )
echo -e "${OUTPUT}"
echo "=============================================================================="
echo "CPPCHECK Summary"
echo "=============================================================================="
echo -e "${NC}"
MAX_ERROR=260
if [ $COUNT -gt $MAX_ERROR ]; then
echo -e ${WARNING}
echo "Total CPPCHECK error Count is $COUNT, which is too High (Max is $MAX_ERROR)! CPPCHECK Run failed";
echo -e "${NC}"
exit 1;
else
echo "Total CPPCHECK error Count is $COUNT ... OK"
fi
#!/bin/bash
if [ ! -d build-release ]; then
mkdir build-release
fi
cd build-release
#clean old cmake cache as the path might have changed (there should be no cmakecache)
find . -name "CMakeCache.txt" -type f -delete
cmake -DCMAKE_BUILD_TYPE=Release -DOPENFLIPPER_BUILD_UNIT_TESTS=FALSE ../
make doc >> Doxygen-warning.log 2> Doxygen-error.log
# Copy to webserver
scp -r -P 2222 Build/share/OpenFlipper/Doc/DeveloperHTML/* gitlab@web4-info8:OpenFlipper-Free-Daily/Doc/Free/Developer
scp -r -P 2222 Build/share/OpenFlipper/Doc/UserHTML/* gitlab@web4-info8:OpenFlipper-Free-Daily/Doc/Free/User
#!/bin/bash
# Script abort on error
set -e
# Expected Settings via environment variables:
# COMPILER= gcc/clang
# LANGUAGE= C++98 / C++11
# QTVERSION= qt5
# BUILDTYPE= debug / eelease
#include ci options script
MY_DIR=$(dirname $(readlink -f $0))
source CI/ci-linux-config.sh
echo "Building with path: $BUILDPATH"
echo "Full cmake options: $OPTIONS "
########################################
# Fetch test data
########################################
rm -rf TestData
#git clone git@roosevelt:moebius/OpenFlipper-Test-Data.git TestData
git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@www.graphics.rwth-aachen.de:9000/moebius/OpenFlipper-Test-Data.git TestData
#########################################
# Build Release version and Unittests
#########################################
# Make release build folder
if [ ! -d $BUILDPATH ]; then
mkdir $BUILDPATH
fi
cd $BUILDPATH
cmake -DOPENFLIPPER_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON $OPTIONS ../
#build it
make $MAKE_OPTIONS
# copy the used shared libraries to the lib folder
cd Build
if [ ! -d systemlib ]; then
mkdir systemlib
fi
ldd bin/OpenFlipper | grep "=> /" | awk '{print $3}' | xargs -I '{}' cp -v '{}' systemlib
cd ../..
#create an artifact directory
if [ ! -d artifacts ]; then
mkdir artifacts
fi
cp -R * artifacts
rsync -a --exclude=artifacts --exclude=.git . ./artifacts
cd artifacts
rm -rf .git
# create an archive with all the build files so we can use them in the test script
tar -cvf ../buildfiles.tar .
cd ..
#!/bin/bash
OPTIONS=""
MAKE_OPTIONS=""
BUILDPATH="build"
#set default Build type to Release
if [ "$BUILDTYPE" == "" ]; then
BUILDTYPE="release"
fi
# set buildpath according to buildtype
BUILDPATH="$BUILDPATH-$BUILDTYPE"
#set CMake build Type
OPTIONS="-DCMAKE_BUILD_TYPE=$BUILDTYPE"
if [ "$COMPILER" == "gcc" ]; then
echo "Setting Compiler to GCC";
BUILDPATH="$BUILDPATH-gcc"
# without icecc: no options required
# OPTIONS="$OPTIONS -DCMAKE_CXX_COMPILER=/usr/lib/icecc/bin/g++ -DCMAKE_C_COMPILER=/usr/lib/icecc/bin/gcc"
MAKE_OPTIONS="-j16"
export ICECC_CXX=/usr/bin/g++ ; export ICECC_CC=/usr/bin/gcc
elif [ "$COMPILER" == "clang" ]; then
OPTIONS="$OPTIONS -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DGTEST_PREFIX=~/sw/gtest-1.8.0-clang/ "
# Build options with icecc /not working due to strange symbol errors
# OPTIONS="$OPTIONS -DCMAKE_CXX_COMPILER=/usr/lib/icecc/bin/g++ -DCMAKE_C_COMPILER=/usr/lib/icecc/bin/gcc -DGTEST_PREFIX=~/sw/gtest-1.7.0-clang/ "
# export ICECC_CXX=/usr/bin/clang++ ; export ICECC_CC=/usr/bin/clang
BUILDPATH="$BUILDPATH-clang"
MAKE_OPTIONS="-j6"
echo "Setting compiler to CLANG";
fi
if [ "$LANGUAGE" == "cpp98" ]; then
echo "Using C++98 standard";
BUILDPATH="$BUILDPATH-cpp98"
elif [ "$LANGUAGE" == "cpp11" ]; then
echo "Using C++11 standard";
OPTIONS="$OPTIONS -DCMAKE_CXX_FLAGS='-std=c++11' "
BUILDPATH="$BUILDPATH-cpp11"
fi
if [ "$QTVERSION" == "qt5.13.0" ]; then
echo "Using QT5.13.0";
BUILDPATH="$BUILDPATH-qt5.13.0"
OPTIONS="$OPTIONS -DQWT6_INCLUDE_DIR=~/sw/qwt-6.1.4-qt5.13.0/include -DQWT6_LIBRARY_DIR=~/sw/qwt-6.1.4-qt5.13.0/lib -DQWT6_LIBRARY=~/sw/qwt-6.1.4-qt5.13.0/lib/libqwt.so -DQT5_INSTALL_PATH=~/sw/Qt/5.13.0/gcc_64"
elif [ "$QTVERSION" == "qt5.12.2" ]; then
echo "Using QT5.12.2";
BUILDPATH="$BUILDPATH-qt5.12.2"
OPTIONS="$OPTIONS -DQWT6_INCLUDE_DIR=~/sw/qwt-6.1.4-qt5.12.2/include -DQWT6_LIBRARY_DIR=~/sw/qwt-6.1.4-qt5.12.2/lib -DQWT6_LIBRARY=~/sw/qwt-6.1.4-qt5.12.2/lib/libqwt.so -DQT5_INSTALL_PATH=~/sw/Qt/5.12.2/gcc_64"
elif [ "$QTVERSION" == "qt5.11.2" ]; then
echo "Using QT5.11.2";
BUILDPATH="$BUILDPATH-qt5.11.2"
OPTIONS="$OPTIONS -DQWT6_INCLUDE_DIR=~/sw/qwt-6.1.3-qt5.11.2/include -DQWT6_LIBRARY_DIR=~/sw/qwt-6.1.3-qt5.11.2/lib -DQWT6_LIBRARY=~/sw/qwt-6.1.3-qt5.11.2/lib/libqwt.so -DQT5_INSTALL_PATH=~/sw/Qt/5.11.2/gcc_64"
elif [ "$QTVERSION" == "qt5.9.0" ]; then
echo "Using QT5.9.0";
BUILDPATH="$BUILDPATH-qt5.9.0"
OPTIONS="$OPTIONS -DQWT6_INCLUDE_DIR=~/sw/qwt-6.1.3-qt5.9.0/include -DQWT6_LIBRARY_DIR=~/sw/qwt-6.1.3-qt5.9.0/lib -DQWT6_LIBRARY=~/sw/qwt-6.1.3-qt5.9.0/lib/libqwt.so -DQT5_INSTALL_PATH=~/sw/Qt/5.9/gcc_64"
elif [ "$QTVERSION" == "qt5.13.2" ]; then
echo "Using QT5.13.2";
BUILDPATH="$BUILDPATH-qt5.13.2"
OPTIONS="$OPTIONS -DQWT6_INCLUDE_DIR=~/sw/qwt-6.1.4-qt5.13.2/include -DQWT6_LIBRARY_DIR=~/sw/qwt-6.1.4-qt5.13.2/lib -DQWT6_LIBRARY=~/sw/qwt-6.1.4-qt5.13.2/lib/libqwt.so -DQT5_INSTALL_PATH=~/sw/Qt/5.13.2/gcc_64"
elif [ "$QTVERSION" == "qt5.15.1" ]; then
echo "Using QT5.15.1";
BUILDPATH="$BUILDPATH-qt5.15.1"
OPTIONS="$OPTIONS -DQWT6_INCLUDE_DIR=~/sw/qwt-6.1.5-qt5.15.1/include -DQWT6_LIBRARY_DIR=~/sw/qwt-6.1.5-qt5.15.1/lib -DQWT6_LIBRARY=~/sw/qwt-6.1.5-qt5.15.1/lib/libqwt.so -DQT5_INSTALL_PATH=~/sw/Qt/5.15.1/gcc_64"
fi
if [ "$PYTHON" == "no" ]; then
echo "No python";
BUILDPATH="$BUILDPATH-nopython"
OPTIONS="$OPTIONS -DDISABLE_OPENFLIPPER_PYTHON_SYSTEM=TRUE"
fi
if test -z "$SSH_PRIVATE_KEY"
then
echo Skipping ssh environment preparation
else
# Preparing ssh environment
echo Prepare ssh environment
which ssh-agent || ( echo No SSH Agent found && exit 1 )
eval $(ssh-agent -s)
echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
mkdir -p ~/.ssh
chmod 700 ~/.ssh
fi
if [ ! -d "~/sw/.git" ]; then
echo Library update skipped
else
git -C "~/sw" remote add alt https://gitlab-ci-token:${CI_JOB_TOKEN}@www.graphics.rwth-aachen.de:9000/Library-Management/Linux-Libraries.git openflipper/Linux-Libraries
git -C "~/sw" checkout master
git -C "~/sw" pull alt master
git -C "~/sw" remote remove alt
fi
echo "Buildpath is: $BUILDPATH"
#!/bin/bash
# Script abort on error
set -e
# Expected Settings via environment variables:
# COMPILER= gcc/clang
# LANGUAGE= C++98 / C++11
# QTVERSION= qt5
# BUILDTYPE= debug / release
#include ci options script
MY_DIR=$(dirname $(readlink -f $0))
source CI/ci-linux-config.sh
# copy artifact files to toplevel and remove subdirectory
mv artifacts-$BUILDPATH artifacts
rsync -a $MY_DIR/.. $MY_DIR/../..
rm -rf artifacts
########################################
# Fetch test data
########################################
rm -rf TestData
git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@www.graphics.rwth-aachen.de:9000/moebius/OpenFlipper-Test-Data.git TestData
#########################################
# Run Release Unittests
#########################################
cd $BUILDPATH
# copy the used shared libraries to the lib folder
cd Build
if [ ! -d systemlib ]; then
mkdir systemlib
fi
ldd bin/OpenFlipper | grep "=> /" | awk '{print $3}' | xargs -I '{}' cp -v '{}' systemlib
cd ..
#clean old cmake cache as the path might have changed
find . -name "CMakeCache.txt" -type f -delete
#just to be safe clean the test file definitions too
if [ -f CTestTestfile.cmake ]
then
echo "Removing old CTestTestfile.cmake"
rm CTestTestfile.cmake
fi
#just to be safe clean the test file definitions too
if [ -f DartConfiguration.tcl ]
then
echo "Removing old DartConfiguration.tcl"
rm DartConfiguration.tcl
fi
#cmake -DOPENFLIPPER_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON $OPTIONS ../
#tell the location to the libs from build jobs
export LD_LIBRARY_PATH=$(pwd)/Build/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$(pwd)/Build/systemlib:$LD_LIBRARY_PATH
#make test
cd tests
bash run_tests.sh
cd ..
#!/bin/bash
# Script abort on error
set -e
########################################
# Fetch test data
########################################
rm -rf TestData
git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@www.graphics.rwth-aachen.de:9000/moebius/OpenFlipper-Test-Data.git TestData
########################################
# Build
########################################
if [ ! -d build-release ]; then
mkdir build-release
fi
cd build-release
# Build without ports to avoid qt4 collision
/opt/local/bin/cmake ../ -DCMAKE_CXX_FLAGS='-std=c++11' -DQWT6_INCLUDE_DIR=/Users/jenkins/sw/qwt-6.1.3-qt5.11.3/lib/qwt.framework/Headers -DQWT6_LIBRARY=/Users/jenkins/sw/qwt-6.1.3-qt5.11.3/lib/qwt.framework -DQT5_INSTALL_PATH=/Users/jenkins/sw/Qt/5.11.3/clang_64/
make -j2
# Required for the tests to build, if a package was generated
make fixbundle
cd ..
#create an artifact directory
if [ ! -d artifacts ]; then
mkdir artifacts
fi
#cp -R * artifacts
rsync -a --exclude=artifacts --exclude=.git . ./artifacts
# leave artifacts subdirectory and copy files to toplevel
rsync -a ./artifacts ./
rm -rf artifacts
########################################
# Fetch test data
########################################
rm -rf TestData
git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@www.graphics.rwth-aachen.de:9000/moebius/OpenFlipper-Test-Data.git TestData
#paths should be there as they are artifacts from prior stage
cd build-release
#clean old cmake cache as the path might have changed
find . -name "CMakeCache.txt" -type f -delete
#just to be safe clean the test file definitions too
if [ -f CTestTestfile.cmake ]
then
rm CTestTestfile.cmake
fi
#just to be safe clean the test file definitions too
if [ -f DartConfiguration.tcl ]
then
rm DartConfiguration.tcl
fi
# Build without ports to avoid qt4 collision
# fix pathes if run on a different machine
/opt/local/bin/cmake ../ -DCMAKE_CXX_FLAGS='-std=c++11' -DQWT6_INCLUDE_DIR=/Users/jenkins/sw/qwt-6.1.3-qt5.11.3/lib/qwt.framework/Headers -DQWT6_LIBRARY=/Users/jenkins/sw/qwt-6.1.3-qt5.11.3/lib/qwt.framework -DQT5_INSTALL_PATH=/Users/jenkins/sw/Qt/5.11.3/clang_64/
rm -f *.dmg
make OpenFlipper_package
mv *.dmg OpenFlipper-Free-GIT-$CI_BUILD_REF-QT5.11.3-CPP11.dmg
# leave artifacts subdirectory and copy files to toplevel
rsync -a ./artifacts ./
rm -rf artifacts
########################################
# Fetch test data
########################################
rm -rf TestData
git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@www.graphics.rwth-aachen.de:9000/moebius/OpenFlipper-Test-Data.git TestData
#expect the build-release folder to be present the program binaries are there
cd build-release
#clean old cmake cache as the path might have changed
find . -name "CMakeCache.txt" -type f -delete
#just to be safe clean the test file definitions too
if [ -f CTestTestfile.cmake ]
then
rm CTestTestfile.cmake
fi
#just to be safe clean the test file definitions too
if [ -f DartConfiguration.tcl ]
then
rm DartConfiguration.tcl
fi
# Build without ports to avoid qt4 collision
# run this prior testing to fix paths
/opt/local/bin/cmake ../ -DCMAKE_CXX_FLAGS='-std=c++11' -DQWT6_INCLUDE_DIR=/Users/jenkins/sw/qwt-6.1.3-qt5.11.3/lib/qwt.framework/Headers -DQWT6_LIBRARY=/Users/jenkins/sw/qwt-6.1.3-qt5.11.3/lib/qwt.framework -DQT5_INSTALL_PATH=/Users/jenkins/sw/Qt/5.11.3/clang_64/
########################################
# Test
########################################
# Run tests
cd tests
bash run_tests.sh
# This script just creates compressed files of OpenFlipper sources
# Create Build directory and Build documentation
mkdir build-doc
cd build-doc
cmake ..
make doc
cd ..
# Extract Version Information
VERSION=OpenFlipper-$(cat OpenFlipper/VERSION | grep VERSION | tr -d "VERSION=")
# Create Publishing directory
mkdir $VERSION
# Move all files into Publishing directory
mv OpenFlipper $VERSION/
mv Plugin-* $VERSION/
mv PluginCollection* $VERSION/
mv Type* $VERSION/
mv CMakeLists.txt $VERSION/
mv COPYING $VERSION/
mv Readme.md $VERSION/
cd $VERSION
find . -name "*git*" | xargs rm -rf
cd ..
mkdir $VERSION/Documentation
mv build-doc/Build/share/OpenFlipper/Doc/DeveloperHTML/ $VERSION/Documentation/DeveloperHTML
mv build-doc/Build/share/OpenFlipper/Doc/UserHTML/ $VERSION/Documentation/UserHTML
tar cjf $VERSION.tar.bz2 $VERSION
tar czf $VERSION.tar.gz $VERSION
zip -9 -q -r $VERSION.zip $VERSION
@echo off
REM bootstrapping script for stage 2 ci scripts
REM to avoid repetitive cloning, in lieu of the sgitlab tickyrunners
REM we copy the entire content of our bild folder to an artifacts subdolder
REM and share it with other buildstages.
REM
REM initial building is considered as stage 0,this script is stage 1 all
REM following stages are stage 2. The purpos of this script is to move all
REM files from the artifacts directory back to the root directory and call
REM the script for this ci job.
REM This way the stage 2 script can delete the artifacts folder safely, as
REM deleting a script that is running will cause an error on windows systems.
REM
REM #######################################
REM # bootstrap level 0
REM #######################################
IF "%BOOTSTRAPLEVEL%" == "" (
set BOOTSTRAPLEVEL=0
)
IF "%BOOTSTRAPLEVEL%" == "0" (
REM copy all files from artifacts folder to root folder
echo %TIME%: Restoring artifacts from artifacts directory ...
robocopy artifacts ./ /e /NFL /NDL /NJH /NJS /nc /ns /np
REM set the bootstrap level to 1
echo %TIME%: Entering bootstrap level 1 ...
set BOOTSTRAPLEVEL=1
REM call the copy of this script outside artifacts folder
call %~dp0\..\..\CI\ci-windows-bootstrap.bat
REM return the error code if not 0
IF "%errorlevel%" NEQ "0" exit /b %errorlevel%
) else (
REM #######################################
REM # bootstrap level 1
REM #######################################
REM remove the artifacts folder, it may cause problems with e.g. cmake
echo %Time%: Removing artifacts directory ...
rmdir /Q /S artifacts
REM call the stage 2 script
echo %Time%: Calling %~dp0\%STAGE2SCRIPT% ...
call %~dp0\%STAGE2SCRIPT%
REM store the error code of the stage 2 script
set bootstrapretval=%errorlevel%
REM copy this script back to the artifacts folder
if not exist ./artifacts (
echo %Time%: recrerating artifacts directory ...
cd %~dp0\..
mkdir artifacts
cd artifacts
mkdir CI
cd ..
)
echo %Time%: restoring bootstrap script ...
copy %~dp0\ci-windows-bootstrap.bat artifacts\CI\ci-windows-bootstrap.bat
REM when this script returns, the windows Command interpreter will look
REM at the original position for the script to continue after the the call command
REM of level 0
IF "%bootstrapretval%" NEQ "0" exit /b %bootstrapretval%
)
\ No newline at end of file
@echo off
::########################################
::# Fetch test data
::########################################
rmdir /Q /S TestData
:: clone libraries git (set env variable to GIT_SSH_COMMAND maybe use setx once as this key won't change)
set GIT_SSH_COMMAND=ssh -i E:\\\gitlab\\\id_rsa
git clone git@roosevelt.informatik.rwth-aachen.de:moebius/OpenFlipper-Test-Data.git TestData
::load configuration and settings
call %~dp0\ci-windows-config.bat
echo "CMAKE_CONFIGURATION: %CMAKE_CONFIGURATION%"
s
ECHO "============================================================="
ECHO "============================================================="
ECHO "Building with :"
whoami
ECHO "ARCHITECTURE : %ARCHITECTURE%"
ECHO "BUILD_PLATFORM : %BUILD_PLATFORM%"
ECHO "GTESTVERSION : %GTESTVERSION%"
ECHO "GENERATOR : %GENERATOR%"
ECHO "VS_PATH : %VS_PATH%"
ECHO "LIBPATH : %LIBPATH%"
ECHO "QT_INSTALL_PATH : %QT_INSTALL_PATH%"
ECHO "CMAKE_CONFIGURATION : %CMAKE_CONFIGURATION%"
ECHO "============================================================="
ECHO "============================================================="
ECHO ""
ECHO "Running Build environment checks"
IF EXIST %LIBPATH%\ (
ECHO "LIBPATH ... Ok"
) ELSE (
ECHO "LIBPATH not found!"
exit 10;
)
IF EXIST %QT_INSTALL_PATH%\ (
ECHO "QT_INSTALL_PATH ... Ok"
) ELSE (