From 74bfad3cfa5462856d03872c02229423f9a36b9f Mon Sep 17 00:00:00 2001 From: Tomas Kulhanek Date: Tue, 22 Jan 2019 14:14:33 +0000 Subject: UPDATE: check git branch, upload master build --- build/jenkins-build.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'build') diff --git a/build/jenkins-build.sh b/build/jenkins-build.sh index 7ac4539..840afac 100755 --- a/build/jenkins-build.sh +++ b/build/jenkins-build.sh @@ -32,6 +32,7 @@ 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 conda install -y conda-build @@ -46,8 +47,10 @@ echo files created: $REG_FILES # upload to anaconda only if token is defined # and TODO pull request not to upload +GIT_BRANCH=`git rev-parse --abbrev-ref HEAD` +echo on branch ${GIT_BRANCH} -if [[ -n ${CCPI_CONDA_TOKEN} ]] +if [[ -n ${CCPI_CONDA_TOKEN} && ${GIT_BRANCH}=="master" ]] then conda install anaconda-client while read -r outfile; do @@ -61,5 +64,5 @@ then fi done <<< "$REG_FILES" else - echo CCPI_CONDA_TOKEN not defined, will not upload to anaconda. + echo CCPI_CONDA_TOKEN not defined or git branch is not master, will not upload to anaconda. fi -- cgit v1.2.3