forked from prisms-center/prisms_jobs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_conda.sh
32 lines (25 loc) · 862 Bytes
/
build_conda.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
# function to allow passing conda build command line arguments
build_conda () {
# build, get location of result, upload
conda build $1 conda-recipes/prisms_jobs > conda-recipes/tmp.out
LOCATION=$(grep 'conda upload' conda-recipes/tmp.out | cut -f3 -d ' ')
if [ -z $LOCATION ]; then
LOCATION=$(grep 'Nothing to test for' conda-recipes/tmp.out | cut -f5 -d ' ')
fi
anaconda upload --user prisms-center $LOCATION
if [[ "$OSTYPE" == "linux-gnu" ]]; then
OTHER=osx-64
elif [[ "$OSTYPE" == "darwin"* ]]; then
OTHER=linux-64
fi
# if on linux, convert to osx
conda convert --platform $OTHER $LOCATION -o conda-recipes
FILE=$(basename $LOCATION)
anaconda upload --user prisms-center conda-recipes/$OTHER/$FILE
}
# begin
anaconda login
build_conda "--python 2.7"
build_conda "--python 3.6"
# finish
anaconda logout