diff options
author | vagrant <vagrant@localhost.localdomain> | 2019-01-21 15:05:59 +0000 |
---|---|---|
committer | vagrant <vagrant@localhost.localdomain> | 2019-01-21 15:05:59 +0000 |
commit | be48430f8de0ccb8e64abba4f00c771228ff0df0 (patch) | |
tree | 7a0ad8c6437030ab1f9c4b8396732e23fa109d2e /build/jenkins-build.sh | |
parent | 400894771a9ff54c3f88e84ecc79d97a3e08235f (diff) | |
download | regularization-be48430f8de0ccb8e64abba4f00c771228ff0df0.tar.gz regularization-be48430f8de0ccb8e64abba4f00c771228ff0df0.tar.bz2 regularization-be48430f8de0ccb8e64abba4f00c771228ff0df0.tar.xz regularization-be48430f8de0ccb8e64abba4f00c771228ff0df0.zip |
UPDATE: CIL_VERSION from git tag, dash in version is assumed as dev version
Diffstat (limited to 'build/jenkins-build.sh')
-rwxr-xr-x | build/jenkins-build.sh | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/build/jenkins-build.sh b/build/jenkins-build.sh index d1a3427..44fd59d 100755 --- a/build/jenkins-build.sh +++ b/build/jenkins-build.sh @@ -7,9 +7,15 @@ else # TODO put git tag recognition, or default #export CIL_VERSION=0.10.4 #get tag, remove first char ('v') and leave rest - export CIL_VERSION_RAW=`git describe --tags | tail -c +2` - - echo Defining version from last git tag and commit: $CIL_VERSION + 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 $C1 | cut -d "-" -f -2` + echo Building dev 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 @@ -27,7 +33,7 @@ else 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 #export CIL_VERSION=0.10.2 #cd CCPi-Regularisation-Toolkit # already there by jenkins @@ -45,7 +51,12 @@ then while read -r outfile; do #TODO if git tag is defined than call anaconda without --label dev #TODO if pull request??? do not upload - anaconda -v -t ${CCPI_CONDA_TOKEN} upload $outfile --force --label dev + 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. |