-
Notifications
You must be signed in to change notification settings - Fork 8
/
bootstrap.sh
executable file
·57 lines (47 loc) · 1.35 KB
/
bootstrap.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
51
52
53
54
55
56
57
#
# Quick script to bootstrap a clean build environment
# MUST be run from the root package directory
#
set -e
trap '{ test -f .bootstrap.msg && cat .bootstrap.msg; rm -f .bootstrap.msg; }' EXIT
if hash conda 2>/dev/null; then
echo 'Detected existing conda on $PATH:'
echo
echo " $(which conda)"
echo
echo 'Having multiple Conda installs on the path is not recommended.'
echo 'Remove it and try again.'
exit -1
fi
#
# Install Miniconda
#
if [[ ! -f "$PWD/miniconda/.installed" ]]; then
case "$OSTYPE" in
linux*) MINICONDA_SH=Miniconda-latest-Linux-x86_64.sh ;;
darwin*) MINICONDA_SH=Miniconda-latest-MacOSX-x86_64.sh ;;
*) echo "Unsupported OS $OSTYPE. Exiting."; exit -1 ;;
esac
rm -f "$MINICONDA_SH"
rm -rf "$PWD/miniconda"
curl -O https://repo.continuum.io/miniconda/"$MINICONDA_SH"
bash "$MINICONDA_SH" -b -p "$PWD/miniconda"
rm -f "$MINICONDA_SH"
#
# Install prerequisites
#
export PATH="$PWD/miniconda/bin:$PATH"
conda install conda-build jinja2 requests sqlalchemy pip --yes
pip install requests_file
# marker that we're done
touch "$PWD/miniconda/.installed"
else
echo
echo "Found Miniconda in $PWD/miniconda; skipping Miniconda install."
echo
fi
echo "Miniconda has been installed in $PWD/miniconda. Add it to your path:"
echo
echo " export PATH=\"\${PWD}/bin:\${PWD}/miniconda/bin:\${PATH}\""
echo
echo "and continue."