Skip to content

Commit

Permalink
separated before_install and install sh files
Browse files Browse the repository at this point in the history
  • Loading branch information
kangwonlee committed Jun 11, 2019
1 parent f1f5ce3 commit f09c46a
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
29 changes: 29 additions & 0 deletions before_install_nix_win_cache.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Set conda path info
if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then
export MINICONDA_PATH=$HOME/miniconda;
export MINICONDA_SUB_PATH=$MINICONDA_PATH/bin;
elif [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
export MINICONDA_PATH=/c/tools/miniconda3;
export MINICONDA_PATH_WIN=`cygpath --windows $MINICONDA_PATH`;
export MINICONDA_SUB_PATH=$MINICONDA_PATH/Scripts;
fi;
export MINICONDA_LIB_BIN_PATH=$MINICONDA_PATH/Library/bin;
# Obtain miniconda installer
if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then
if [[ -f $HOME/download/miniconda.sh ]]; then
echo "miniconda.sh for posix already available";
else
mkdir -p $HOME/download;
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
echo "downloading miniconda.sh for linux";
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O $HOME/download/miniconda.sh;
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
echo "downloading miniconda.sh for osx";
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O $HOME/download/miniconda.sh;
fi;
fi;
fi;
# Install openssl for Windows
if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
choco install openssl.light;
fi;
36 changes: 36 additions & 0 deletions install_nix_win_cache.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Install miniconda
if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then
if [[ -d $MINICONDA_SUB_PATH ]]; then
echo "miniconda for posix already available";
else
echo "installing miniconda for posix";
bash $HOME/download/miniconda.sh -b -u -p $MINICONDA_PATH;
fi;
elif [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
if [[ -d $MINICONDA_SUB_PATH ]]; then
echo "miniconda for Windows already installed";
else
echo "installing miniconda for windows";
choco install miniconda3 --params="'/JustMe /AddToPath:1 /D:$MINICONDA_PATH_WIN'";
fi;
fi;
export PATH="$MINICONDA_PATH:$MINICONDA_SUB_PATH:$MINICONDA_LIB_BIN_PATH:$PATH";
source $MINICONDA_PATH/etc/profile.d/conda.sh;
hash -r;
echo $TRAVIS_OS_NAME
python --version
conda config --set always_yes yes --set changeps1 no;
conda update -q conda;
# Useful for debugging any issues with conda
conda info -a
# See if test-environment already available
# As necessary, apply python module recipies
if [[ ! -d $MINICONDA_PATH/envs/test-environment ]]; then
echo "create test-environment";
conda env create -n test-environment python=$CONDA_PYTHON -f ./tests/environment.${CONDA_PYTHON}.yml;
else
echo "update test-environment";
conda env update -n test-environment python=$CONDA_PYTHON -f ./tests/environment.${CONDA_PYTHON}.yml;
fi;
conda activate test-environment
conda list

0 comments on commit f09c46a

Please sign in to comment.