diff --git a/Jenkinsfile b/Jenkinsfile index 843007c..67dbbdf 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,7 +17,7 @@ timestamps { // Change to corresponding CORE_BRANCH as required // e.g. FOGL-xxxx, main etc. sh ''' - CORE_BRANCH='develop' + CORE_BRANCH='2.2.0RC' ${HOME}/buildFledge ${CORE_BRANCH} ${WORKSPACE} ''' } diff --git a/VERSION b/VERSION index 7ec1d6d..ccbccc3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.1.0 +2.2.0 diff --git a/build.sh b/build.sh index f586d6d..97f5eee 100755 --- a/build.sh +++ b/build.sh @@ -5,10 +5,10 @@ # ./build.sh -DFLEDGE_INSTALL=/some_path/Fledge # -os_name=`(grep -o '^NAME=.*' /etc/os-release | cut -f2 -d\" | sed 's/"//g')` -os_version=`(grep -o '^VERSION_ID=.*' /etc/os-release | cut -f2 -d\" | sed 's/"//g')` +os_name=$(grep -o '^NAME=.*' /etc/os-release | cut -f2 -d\" | sed 's/"//g') +os_version=$(grep -o '^VERSION_ID=.*' /etc/os-release | cut -f2 -d\" | sed 's/"//g') -if [[ ( $os_name == *"Red Hat"* || $os_name == *"CentOS"* ) && $os_version == *"7"* ]]; then +if [[ ( $os_name == *"Red Hat"* || $os_name == *"CentOS"* ) ]]; then if [ -f build_rhel.sh ]; then echo "Custom build for platform is ${os_name}, Version: ${os_version}" ./build_rhel.sh $@ diff --git a/build_rhel.sh b/build_rhel.sh index f5532b9..564f66c 100755 --- a/build_rhel.sh +++ b/build_rhel.sh @@ -4,11 +4,16 @@ # ./build_rhel.sh -DFLEDGE_INSTALL=/some_path/Fledge -source scl_source enable devtoolset-7 -export CC=$(scl enable devtoolset-7 "command -v gcc") -export CXX=$(scl enable devtoolset-7 "command -v g++") +os_version=$(grep -o '^VERSION_ID=.*' /etc/os-release | cut -f2 -d\" | sed 's/"//g') +# Use scl_source & devtoolset only if OS is RedHat/CentOS 7 +if [[ ${os_version} == *"7"* ]] +then + source scl_source enable devtoolset-7 + export CC=$(scl enable devtoolset-7 "command -v gcc") + export CXX=$(scl enable devtoolset-7 "command -v g++") +fi -mkdir build +mkdir -p build cd build/ cmake $@ .. make diff --git a/fledge.version b/fledge.version index 5c5c46f..78e4465 100644 --- a/fledge.version +++ b/fledge.version @@ -1 +1 @@ -fledge_version>=2.1 +fledge_version>=2.2 diff --git a/requirements.sh b/requirements.sh index 3ef795c..6b0ec03 100755 --- a/requirements.sh +++ b/requirements.sh @@ -20,49 +20,49 @@ ## Author: Mark Riddoch, Massimiliano Pinto ## -fledge_location=`pwd` -os_name=`(grep -o '^NAME=.*' /etc/os-release | cut -f2 -d\" | sed 's/"//g')` -os_version=`(grep -o '^VERSION_ID=.*' /etc/os-release | cut -f2 -d\" | sed 's/"//g')` +set -e + +fledge_location=$(pwd) +os_name=$(grep -o '^NAME=.*' /etc/os-release | cut -f2 -d\" | sed 's/"//g') +os_version=$(grep -o '^VERSION_ID=.*' /etc/os-release | cut -f2 -d\" | sed 's/"//g') echo "Platform is ${os_name}, Version: ${os_version}" -if [[ ( $os_name == *"Red Hat"* || $os_name == *"CentOS"* ) && $os_version == *"7"* ]]; then - echo Installing development tools 7 components - sudo yum install -y yum-utils - sudo yum-config-manager --enable rhel-server-rhscl-7-rpms - sudo yum install -y devtoolset-7 - echo Installing boost components - sudo yum install -y boost-filesystem - sudo yum install -y boost-program-options - source scl_source enable devtoolset-7 - export CC=/opt/rh/devtoolset-7/root/usr/bin/gcc - export CXX=/opt/rh/devtoolset-7/root/usr/bin/g++ +if [[ ( ${os_name} == *"Red Hat"* || ${os_name} == *"CentOS"* ) ]]; then + echo "Installing boost components..." + sudo yum install -y boost-filesystem boost-program-options + + if [[ ${os_version} == *"7"* ]]; then + echo "Installing development tools 7 components..." + sudo yum install -y yum-utils + sudo yum-config-manager --enable rhel-server-rhscl-7-rpms + sudo yum install -y devtoolset-7 + source scl_source enable devtoolset-7 + export CC=/opt/rh/devtoolset-7/root/usr/bin/gcc + export CXX=/opt/rh/devtoolset-7/root/usr/bin/g++ + fi elif apt --version 2>/dev/null; then - echo Installing boost components - sudo apt install -y libboost-filesystem-dev - sudo apt install -y libboost-program-options-dev - sudo apt install -y libmbedtls-dev + echo Installing boost components + sudo apt install -y libboost-filesystem-dev + sudo apt install -y libboost-program-options-dev + sudo apt install -y libmbedtls-dev else - echo "Requirements cannot be automatically installed, please refer README.rst to install requirements manually" + echo "Requirements cannot be automatically installed, please refer README.rst to install requirements manually" fi -if [ $# -eq 1 ]; then +if [[ $# -eq 1 ]]; then directory=$1 - if [ ! -d $directory ]; then - mkdir -p $directory - fi + if [[ ! -d $directory ]]; then mkdir -p $directory; fi else directory=~ fi cd $directory -if [ -d freeopcua ]; then - rm -rf freeopcua -fi +if [[ -d freeopcua ]]; then rm -rf freeopcua; fi echo Fetching Free OPCUA library git clone https://github.com/dianomic/freeopcua.git -git checkout Kapsch cd freeopcua +git checkout Kapsch mkdir build sed \ -e 's/add_library(opcuaclient/add_library(opcuaclient STATIC/' \ @@ -76,5 +76,5 @@ cd build cmake .. make cd .. -echo Set the environment variable FREEOPCUA to `pwd` -echo export FREEOPCUA=`pwd` +echo Set the environment variable FREEOPCUA to $(pwd) +echo export FREEOPCUA=$(pwd)