Skip to content

Commit

Permalink
Merge pull request wtsi-npg#68 from keithj/branch-build-param
Browse files Browse the repository at this point in the history
Added a build parameter to select the common build branch (master/devel)
  • Loading branch information
dkj authored Oct 4, 2016
2 parents dfedb30 + 6fe2085 commit 93dd643
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions scripts/travis_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

set -e -x

# The default build branch for all repositories. This defaults to
# TRAVIS_BRANCH unless set in the Travis build environment.
WTSI_NPG_BUILD_BRANCH=${WTSI_NPG_BUILD_BRANCH:=$TRAVIS_BRANCH}

sudo apt-get install -qq odbc-postgresql
sudo apt-get install libgd2-xpm-dev # For npg_tracking
sudo apt-get install liblzma-dev # For npg_qc
Expand Down Expand Up @@ -65,11 +69,13 @@ cpanm --quiet --notest Module::Build
# WTSI NPG Perl repo dependencies
repos=""
for repo in perl-dnap-utilities perl-irods-wrap ml_warehouse npg_ml_warehouse npg_tracking npg_seq_common npg_qc; do
cd /tmp
git clone --branch master --depth 1 ${WTSI_NPG_GITHUB_URL}/${repo}.git ${repo}.git #always clone master when using depth 1 to get current tag
cd /tmp/${repo}.git
git pull origin ${TRAVIS_BRANCH} || echo 'so, staying on master branch....' #shift off master to appropriate branch (if possible)
repos=$repos" /tmp/${repo}.git"
cd /tmp
# Always clone master when using depth 1 to get current tag
git clone --branch master --depth 1 ${WTSI_NPG_GITHUB_URL}/${repo}.git ${repo}.git
cd /tmp/${repo}.git
# Shift off master to appropriate branch (if possible)
git ls-remote --heads --exit-code origin ${WTSI_NPG_BUILD_BRANCH} && git pull origin ${WTSI_NPG_BUILD_BRANCH} && echo "Switched to branch ${WTSI_NPG_BUILD_BRANCH}"
repos=$repos" /tmp/${repo}.git"
done

# Install CPAN dependencies. The src libs are on PERL5LIB because of
Expand Down

0 comments on commit 93dd643

Please sign in to comment.