From fcaaac822cabb51cb820ee0b387eb0542ffbe4b3 Mon Sep 17 00:00:00 2001 From: spo Date: Mon, 8 Jun 2015 14:33:57 +0300 Subject: [PATCH] Improve build scripts for Jenkins --- make.sh | 3 +-- salome_env.sh | 14 +++++++++----- test.sh | 25 +++++++++++++++++++++++++ test_centos.sh | 3 +++ test_d6.sh | 3 +++ 5 files changed, 41 insertions(+), 7 deletions(-) create mode 100755 test.sh create mode 100755 test_centos.sh create mode 100755 test_d6.sh diff --git a/make.sh b/make.sh index 009f37265..1b5a56e06 100755 --- a/make.sh +++ b/make.sh @@ -8,8 +8,7 @@ SRC_DIR=${ROOT_DIR}/sources BUILD_DIR=build INSTALL_DIR=install -if [ $1 ] -then +if [ $1 ]; then BUILD_DIR=${BUILD_DIR}-$1 INSTALL_DIR=${INSTALL_DIR}-$1 fi diff --git a/salome_env.sh b/salome_env.sh index a270f2563..ae918e290 100644 --- a/salome_env.sh +++ b/salome_env.sh @@ -1,13 +1,17 @@ #!/bin/bash main() { + local salome_version=7.6.0 local platform="$(lsb_release -is)" local release="$(lsb_release -rs)" - if [ "${platform}" == "CentOS" ]; then - export INST_ROOT=/dn48/newgeom/common/SALOME-7.5.1_CentOS-6.3 - elif [ "${platform}" == "Debian" ]; then - if [[ ${release} =~ ^6 ]]; then export INST_ROOT=/dn23/NEWGEOM/common/SALOME-7.5.1_Debian-6.0_SOURCES - elif [[ ${release} =~ ^8 ]]; then export INST_ROOT=/dn23/NEWGEOM/common/SALOME-7.5.1_Debian-8.0_SOURCES + if [[ ${salome_version} == "7.5.1" ]]; then + if [[ "${platform}" == "CentOS" ]]; then export INST_ROOT=/dn48/newgeom/common/SALOME-7.5.1_CentOS-6.3 + elif [[ "${platform}" == "Debian" && ${release} =~ ^6 ]]; then export INST_ROOT=/dn23/NEWGEOM/common/SALOME-7.5.1_Debian-6.0_SOURCES + elif [[ "${platform}" == "Debian" && ${release} =~ ^8 ]]; then export INST_ROOT=/dn23/NEWGEOM/common/SALOME-7.5.1_Debian-8.0_SOURCES + fi + elif [[ ${salome_version} == "7.6.0" ]]; then + if [[ "${platform}" == "CentOS" ]]; then export INST_ROOT=/dn23/NEWGEOM/common/SALOME-7.6.0_CentOS-6.3_SOURCES + elif [[ "${platform}" == "Debian" && ${release} =~ ^6 ]]; then export INST_ROOT=/dn23/NEWGEOM/common/SALOME-7.6.0_Debian-6.0_SOURCES fi fi } diff --git a/test.sh b/test.sh new file mode 100755 index 000000000..ec98d256e --- /dev/null +++ b/test.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# Find absolute path to ROOT_DIR +export ROOT_DIR=$(pwd)/.. +export ROOT_DIR=`cd "${ROOT_DIR}";pwd` + +SRC_DIR=${ROOT_DIR}/sources + +BUILD_DIR=build +INSTALL_DIR=install +if [ $1 ]; then + BUILD_DIR=${BUILD_DIR}-$1 + INSTALL_DIR=${INSTALL_DIR}-$1 +fi + +source ${SRC_DIR}/salome_env.sh +source ${SRC_DIR}/linux_env.sh $1 +mkdir -p ${ROOT_DIR}/${BUILD_DIR} +cd ${ROOT_DIR}/${BUILD_DIR} + +CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=Release" +CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=${ROOT_DIR}/${INSTALL_DIR}" +CMAKE_ARGS="${CMAKE_ARGS} ${SRC_DIR}" + +ctest diff --git a/test_centos.sh b/test_centos.sh new file mode 100755 index 000000000..2efd8b90e --- /dev/null +++ b/test_centos.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +test.sh centos diff --git a/test_d6.sh b/test_d6.sh new file mode 100755 index 000000000..da6c624bc --- /dev/null +++ b/test_d6.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +test.sh d6 -- 2.39.2