Skip to content

Commit

Permalink
Allow installations with customisable env names (#371)
Browse files Browse the repository at this point in the history
* add extra deps and customisable conda env name

*  bugfix CONDA_INSTALL_ENV

*  bugfix CONDA_INSTALL_ENV

*  bugfix CONDA_INSTALL_ENV
  • Loading branch information
sebastian-luna-valero authored Nov 23, 2017
1 parent 122866d commit fdb8321
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 6 deletions.
16 changes: 16 additions & 0 deletions conda/environments/pipelines-ide.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

# This environment will include other dependencies to assist with the development and running of pipelines

name: cgat-p

channels:
- bioconda
- conda-forge
- defaults

dependencies:
- sphinx_bootstrap_theme
- rstudio
- spyder
- multiqc

46 changes: 40 additions & 6 deletions install-CGAT-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,11 @@ else

fi # if travis install

# set installation folder
CONDA_INSTALL_DIR=$CGAT_HOME/conda-install
CONDA_INSTALL_ENV="cgat-p"

# set conda environment name
[[ ${CONDA_INSTALL_ENV} ]] || CONDA_INSTALL_ENV="cgat-p"

} # get_cgat_env

Expand Down Expand Up @@ -244,10 +247,7 @@ if [[ "$OS" != "travis" ]] ; then
if [[ $INSTALL_DEVEL ]] || [[ $INSTALL_PRODUCTION ]] ; then

# install extra deps
wget -O env-extra-pipelines.yml https://raw.githubusercontent.com/CGATOxford/CGATPipelines/${TRAVIS_BRANCH}/conda/environments/pipelines-extra.yml
conda env update --quiet --name ${CONDA_INSTALL_ENV} --file env-extra-pipelines.yml
wget -O env-extra-scripts.yml https://raw.githubusercontent.com/CGATOxford/cgat/${SCRIPTS_BRANCH}/conda/environments/scripts-extra.yml
conda env update --quiet --name ${CONDA_INSTALL_ENV} --file env-extra-scripts.yml
install_extra_deps

# make sure you are in the CGAT_HOME folder
cd $CGAT_HOME
Expand Down Expand Up @@ -326,6 +326,27 @@ fi # if travis install
} # conda install


# install extra dependencies
install_extra_deps() {

log "install extra deps"

wget -O env-extra-pipelines.yml https://raw.githubusercontent.com/CGATOxford/CGATPipelines/${TRAVIS_BRANCH}/conda/environments/pipelines-extra.yml
wget -O env-extra-scripts.yml https://raw.githubusercontent.com/CGATOxford/cgat/${SCRIPTS_BRANCH}/conda/environments/scripts-extra.yml

conda env update --quiet --name ${CONDA_INSTALL_ENV} --file env-extra-pipelines.yml
conda env update --quiet --name ${CONDA_INSTALL_ENV} --file env-extra-scripts.yml

if [[ $INSTALL_IDE ]] ; then

wget -O env-ide.yml https://raw.githubusercontent.com/CGATOxford/CGATPipelines/${TRAVIS_BRANCH}/conda/environments/pipelines-ide.yml

conda env update --quiet --name ${CONDA_INSTALL_ENV} --file env-ide.yml

fi

}

# need to install the CGAT Code Collection as well
install_cgat_scripts() {

Expand Down Expand Up @@ -608,7 +629,10 @@ SCRIPTS_BRANCH="master"
# type of installation
CONDA_INSTALL_TYPE_PIPELINES=
CONDA_INSTALL_TYPE_SCRIPTS=

# rename conda environment
CONDA_INSTALL_ENV=
# install additional IDEs
INSTALL_IDE=

# parse input parameters
# https://stackoverflow.com/questions/402377/using-getopts-in-bash-shell-script-to-get-long-and-short-command-line-options
Expand Down Expand Up @@ -684,6 +708,16 @@ case $key in
shift 2
;;

--ide)
INSTALL_IDE=1
shift
;;

--env-name)
CONDA_INSTALL_ENV="$2"
shift 2
;;

*)
help_message
;;
Expand Down

0 comments on commit fdb8321

Please sign in to comment.