-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathentrypoint.sh
executable file
·66 lines (49 loc) · 1.3 KB
/
entrypoint.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
#!/bin/bash
set -ex
set -o pipefail
# VARIABLES
CHANNELS=($INPUT_CHANNELS)
PLATFORMS=($INPUT_PLATFORMS)
# check input parameters
DEFAULT_PLAFORMS=("osx-64 linux-32 linux-64 win-32 win-64 noarch")
for PLATFORM in "${PLATFORMS[@]}"
do
if ! [[ " $DEFAULT_PLAFORMS " =~ .*\ $PLATFORM\ .* ]]; then
echo $PLATFORM" platform not supported, only one of them: "$DEFAULT_PLAFORMS
exit 1
fi
done
# TEMP DIR
mkdir temp_build
##### BUILDING PACKAGE #####
echo ">>>> CONDA PACKAGE BUILDING <<<<"
# add channels
for CHANNEL in "${CHANNELS[@]}"
do
conda config --append channels $CHANNEL
done
# build the package
conda mambabuild $INPUT_CONDADIR --output-folder temp_build
# convert package for each platforms
find temp_build/ -name *.tar.bz2 | while read file
do
echo $file
for PLATFORM in "${PLATFORMS[@]}"
do
if ["noarch" != $PLATFORM]; then
conda convert --force --platform $PLATFORM $file -o temp_build/
fi
done
done
##### Uploading on Anaconda Cloud #####
echo ">>>> CONDA PACKAGE UPLOADING <<<<"
# to upload packages
conda config --set anaconda_upload yes
# login
anaconda login --username $INPUT_CONDAUSERNAME --password $INPUT_CONDAPASSWORD
# to upload packages
find temp_build/ -name *.tar.bz2 | while read file
do
echo $file
anaconda upload $file
done