summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Kulhanek <tomas.kulhanek@stfc.ac.uk>2019-01-21 17:15:29 +0000
committerGitHub <noreply@github.com>2019-01-21 17:15:29 +0000
commit9f186d5978aa4e528ea071d5de0a74edb71916ad (patch)
tree45411dd5255691fd4c8495652323c9293c8fb881
parent34d0b9f85c3bc73416f1dc2bb25ef669b9ff8076 (diff)
parent60b4d51ce1cf19be2a3483232448ae227253614c (diff)
downloadregularization-9f186d5978aa4e528ea071d5de0a74edb71916ad.tar.gz
regularization-9f186d5978aa4e528ea071d5de0a74edb71916ad.tar.bz2
regularization-9f186d5978aa4e528ea071d5de0a74edb71916ad.tar.xz
regularization-9f186d5978aa4e528ea071d5de0a74edb71916ad.zip
Merge pull request #88 from TomasKulhanek/pr-test
Pr test
-rw-r--r--CMakeLists.txt5
-rw-r--r--Core/CMakeLists.txt2
-rw-r--r--Wrappers/Python/CMakeLists.txt2
-rw-r--r--Wrappers/Python/conda-recipe/build.sh1
-rw-r--r--Wrappers/Python/conda-recipe/meta.yaml2
-rwxr-xr-xbuild/jenkins-build.sh28
-rw-r--r--recipes/regularisers/build.sh2
7 files changed, 33 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 550b896..b95107a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,7 +25,10 @@ set (CIL_VERSION_MAJOR 0)
set (CIL_VERSION_MINOR 10)
set (CIL_VERSION_PATCH 2)
-set (CIL_VERSION '${CIL_VERSION_MAJOR}.${CIL_VERSION_MINOR}.${CIL_VERSION_PATCH}' CACHE INTERNAL "Core Imaging Library version" FORCE)
+# set (CIL_VERSION '${CIL_VERSION_MAJOR}.${CIL_VERSION_MINOR}.${CIL_VERSION_PATCH}' CACHE INTERNAL "Core Imaging Library version" FORCE)
+# get CIL_VERSION from environment variable and set it in cmake
+set (CIL_VERSION $ENV{CIL_VERSION} CACHE INTERNAL "Core Imaging Library version" FORCE)
+message(STATUS "CIL_VERSION set to " ${CIL_VERSION})
# set the Python variables for the Conda environment
#include(${CMAKE_SOURCE_DIR}/CMake/FindAnacondaEnvironment.cmake)
diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt
index d92db82..b3c0dfb 100644
--- a/Core/CMakeLists.txt
+++ b/Core/CMakeLists.txt
@@ -6,7 +6,7 @@ project(RGL_core)
# The version number.
-#set (CIL_VERSION $ENV{CIL_VERSION} CACHE INTERNAL "Core Imaging Library version" FORCE)
+set (CIL_VERSION $ENV{CIL_VERSION} CACHE INTERNAL "Core Imaging Library version" FORCE)
# conda orchestrated build
message("CIL_VERSION ${CIL_VERSION}")
diff --git a/Wrappers/Python/CMakeLists.txt b/Wrappers/Python/CMakeLists.txt
index d86d0ea..c2ef855 100644
--- a/Wrappers/Python/CMakeLists.txt
+++ b/Wrappers/Python/CMakeLists.txt
@@ -9,7 +9,7 @@ project(regulariserPython)
#set (CIL_VERSION $ENV{CIL_VERSION} CACHE INTERNAL "Core Imaging Library version" FORCE)
# conda orchestrated build
-message("CIL_VERSION ${CIL_VERSION}")
+message("CIL_VERSION: ${CIL_VERSION}")
#include (GenerateExportHeader)
find_package(PythonInterp REQUIRED)
diff --git a/Wrappers/Python/conda-recipe/build.sh b/Wrappers/Python/conda-recipe/build.sh
index eec7c2f..39c0f2c 100644
--- a/Wrappers/Python/conda-recipe/build.sh
+++ b/Wrappers/Python/conda-recipe/build.sh
@@ -5,6 +5,7 @@ cp -rv "$RECIPE_DIR/../../../Core" "$SRC_DIR/Core"
cd $SRC_DIR
##cuda=off
+
cmake -G "Unix Makefiles" $RECIPE_DIR/../../../ -DBUILD_PYTHON_WRAPPER=ON -DCONDA_BUILD=ON -DBUILD_CUDA=ON -DCMAKE_BUILD_TYPE="Release" -DLIBRARY_LIB=$CONDA_PREFIX/lib -DLIBRARY_INC=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$PREFIX
diff --git a/Wrappers/Python/conda-recipe/meta.yaml b/Wrappers/Python/conda-recipe/meta.yaml
index e3258ff..9fe813d 100644
--- a/Wrappers/Python/conda-recipe/meta.yaml
+++ b/Wrappers/Python/conda-recipe/meta.yaml
@@ -5,6 +5,8 @@ package:
build:
preserve_egg_dir: False
number: 0
+ script_env:
+ - CIL_VERSION
test:
files:
diff --git a/build/jenkins-build.sh b/build/jenkins-build.sh
index 6da2c56..ca5b57a 100755
--- a/build/jenkins-build.sh
+++ b/build/jenkins-build.sh
@@ -1,10 +1,22 @@
#!/usr/bin/env bash
+
if [[ -n ${CIL_VERSION} ]]
then
echo Using defined version: $CIL_VERSION
else
- export CIL_VERSION=0.10.4
- echo Defining version: $CIL_VERSION
+
+ #get tag, remove first char ('v') and leave rest
+ export CIL_VERSION=`git describe --tags | tail -c +2`
+ if [[ ${CIL_VERSION} == *"-"* ]]; then
+ # detected dash means that it is dev version
+ # version is then string-string and all after second dash is ignored (usually commit sha)
+ export CIL_VERSION=`echo ${CIL_VERSION} | cut -d "-" -f -2`
+ # but dash is prohibited for conda build
+ export CIL_VERSION=`echo ${CIL_VERSION} | tr - _`
+ echo Building dev version ${CIL_VERSION}
+ else
+ echo Defining version from last git tag and commit: $CIL_VERSION
+ fi
fi
# Script to builds source code in Jenkins environment
# module try-load conda
@@ -20,9 +32,8 @@ else
./Miniconda3-latest-Linux-x86_64.sh -u -b -p .
PATH=$PATH:./bin
fi
-
# presume that git clone is done before this script is launched, if not, uncomment
-# git clone https://github.com/vais-ral/CCPi-Regularisation-Toolkit
+#git clone https://github.com/vais-ral/CCPi-Regularisation-Toolkit
conda install -y conda-build
#cd CCPi-Regularisation-Toolkit # already there by jenkins
# need to call first build
@@ -37,7 +48,14 @@ if [[ -n ${CCPI_CONDA_TOKEN} ]]
then
conda install anaconda-client
while read -r outfile; do
- anaconda -v -t ${CCPI_CONDA_TOKEN} upload $outfile --force --label dev
+ #if 0 commit after tag then call anaconda without --label dev
+ #TODO if pull request??? do not upload
+ if [[ $CIL_VERSION == *"_"* ]]; then
+ # upload with dev label
+ anaconda -v -t ${CCPI_CONDA_TOKEN} upload $outfile --force --label dev
+ else
+ anaconda -v -t ${CCPI_CONDA_TOKEN} upload $outfile --force
+ fi
done <<< "$REG_FILES"
else
echo CCPI_CONDA_TOKEN not defined, will not upload to anaconda.
diff --git a/recipes/regularisers/build.sh b/recipes/regularisers/build.sh
index 0b8bce2..eaa778e 100644
--- a/recipes/regularisers/build.sh
+++ b/recipes/regularisers/build.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
-echo $CIL_VERSION
+echo build.sh CIL_VERSION: $CIL_VERSION
#if [ -z "$CIL_VERSION" ]; then
# echo "Need to set CIL_VERSION"
# exit 1