forked from mjuric/conda-lsst
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.sh
executable file
·73 lines (59 loc) · 1.76 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#
# 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
#
# Add git-lfs support
#
export PATH="$PWD/miniconda/bin:$PATH"
if ! conda list lsst-git-lfs-config >/dev/null; then
echo "Building and installing git-lfs and lsst-git-lfs-config. Patience please..."
echo
conda build etc/recipes/git-lfs >>.bootstrap.msg 2>&1
conda build etc/recipes/lsst-git-lfs-config >>.bootstrap.msg 2>&1
conda install -q --yes --use-local lsst-git-lfs-config >>.bootstrap.msg 2>&1
rm -f .bootstrap.msg
fi
echo "Miniconda has been installed in $PWD/miniconda. Add it to your path:"
echo
echo " export PATH=\"$PWD/miniconda/bin:\$PATH\""
echo
echo "and continue."