-
Notifications
You must be signed in to change notification settings - Fork 0
/
conda_pipeline.sh
55 lines (48 loc) · 1.21 KB
/
conda_pipeline.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
#!/bin/bash
# File : conda_pipeline.sh
# Time : 2021/12/05
# Author : Yujie He
# Contact : he-yujie@outlook.com
# State : Tested
# Reference : xxx
# Example:
# > sh conda_pipeline.sh -e=test -t=test
# CONDA ENVIRONMENT = test
# TEST TYPE = test
# ########## Python scripts in given env ##########
# ########## Finished!!! ##########
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/he/miniconda/bin/conda' 'shell.bash' 'hook' 2>/dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/home/he/miniconda/etc/profile.d/conda.sh" ]; then
. "/home/he/miniconda/etc/profile.d/conda.sh"
else
export PATH="/home/he/miniconda/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
for i in "$@"; do
case $i in
-e=* | --env=*)
ENVIRONMENT="${i#*=}"
shift # past argument=value
;;
-t=* | --type=*)
TYPE="${i#*=}"
shift # past argument=value
;;
*)
# unknown option
;;
esac
done
echo "CONDA ENVIRONMENT = ${ENVIRONMENT}"
echo "TEST TYPE = ${TYPE}"
conda activate ${ENVIRONMENT}
echo "########## Python scripts in given env ##########"
# python3 xxx.py
echo "########## Finished!!! ##########"