forked from ryanlayer/samplot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
50 lines (39 loc) · 1.33 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
set -exo pipefail
WORKSPACE=$(pwd)
# Set path
echo "export PATH=$WORKSPACE/anaconda/bin:$PATH" >> $BASH_ENV
source $BASH_ENV
## Passed from .circleci/config.yml (Only 3 permited)
pythonversion=$1
if (( $pythonversion != 3 ))
then
echo -e "\nERROR: Python 3 designation required. Python version $pythonversion was supplied. Please correct and run again\n"
exit 1
fi
# setup conda and dependencies
if [[ ! -d $WORKSPACE/anaconda ]]; then
mkdir -p $WORKSPACE
# step 1: download and install anaconda
if [[ $OSTYPE == darwin* ]]; then
tag="MacOSX"
tag2="darwin"
elif [[ $OSTYPE == linux* ]]; then
tag="Linux"
tag2="linux"
else
echo "Unsupported OS: $OSTYPE"
exit 1
fi
curl -O https://repo.anaconda.com/miniconda/Miniconda$pythonversion-latest-$tag-x86_64.sh
sudo bash Miniconda$pythonversion-latest-$tag-x86_64.sh -b -p $WORKSPACE/anaconda/
sudo chown -R $USER $WORKSPACE/anaconda/
mkdir -p $WORKSPACE/anaconda/conda-bld/$tag-64
# step 3: setup channels
conda config --system --add channels defaults
conda config --system --add channels r
conda config --system --add channels bioconda
conda config --system --add channels conda-forge
# step 3: install Samplot requirements
conda install -y --file requirements.txt
fi