-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdeploy_script.sh
executable file
·84 lines (75 loc) · 3.42 KB
/
deploy_script.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
74
75
76
77
78
79
80
81
82
83
84
## Copyright [2017-2018] UMR MISTEA INRA, UMR LEPSE INRA, ##
## UMR AGAP CIRAD, EPI Virtual Plants Inria ##
## ##
## This file is part of the StatisKit project. More information can be ##
## found at ##
## ##
## http://autowig.rtfd.io ##
## ##
## The Apache Software Foundation (ASF) licenses this file to you under ##
## the Apache License, Version 2.0 (the "License"); you may not use this ##
## file except in compliance with the License. You should have received ##
## a copy of the Apache License, Version 2.0 along with this file; see ##
## the file LICENSE. If not, you may obtain a copy of the License at ##
## ##
## http://www.apache.org/licenses/LICENSE-2.0 ##
## ##
## Unless required by applicable law or agreed to in writing, software ##
## distributed under the License is distributed on an "AS IS" BASIS, ##
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or ##
## mplied. See the License for the specific language governing ##
## permissions and limitations under the License. ##
set -e
set +v
source environ.sh
set -ev
conda activate
python anaconda_packages.py
source anaconda_packages.sh
rm anaconda_packages.sh
if [[ "${DOCKER_DEPLOY}" = "true" ]]
then
if [[ ! "${DOCKER_CONTEXT}" = "" ]]
then
if [[ ! "${CONDA_VERSION}" = "3" ]]
then
sudo docker push ${DOCKER_OWNER}/${DOCKER_CONTAINER}:${TRAVIS_TAG}-py${CONDA_VERSION}k
else
sudo docker push ${DOCKER_OWNER}/${DOCKER_CONTAINER}:${TRAVIS_TAG}
fi
if [[ ! "${TRAVIS_TAG}" = "latest" ]]
then
if [[ ! "${CONDA_VERSION}" = "3" ]]
then
sudo docker tag ${DOCKER_OWNER}/${DOCKER_CONTAINER}:${TRAVIS_TAG}-py${CONDA_VERSION}k ${DOCKER_OWNER}/${DOCKER_CONTAINER}:latest-py${CONDA_VERSION}k
sudo docker push ${DOCKER_OWNER}/${DOCKER_CONTAINER}:latest-py${CONDA_VERSION}k
else
sudo docker tag ${DOCKER_OWNER}/${DOCKER_CONTAINER}:${TRAVIS_TAG} ${DOCKER_OWNER}/${DOCKER_CONTAINER}:latest
sudo docker push ${DOCKER_OWNER}/${DOCKER_CONTAINER}:latest
fi
fi
fi
fi
if [[ "${ANACONDA_DEPLOY}" = "true" ]]
then
if [[ ! "${CONDA_RECIPE}" = "" ]]
then
anaconda upload ${ANACONDA_SUCCESS_PACKAGES} -u ${ANACONDA_OWNER} ${ANACONDA_FORCE} --label ${ANACONDA_TMP_LABEL} --no-progress
rm ${ANACONDA_SUCCESS_PACKAGES}
fi
fi
if [[ "${ANACONDA_RELEASE}" = "start" ]]
then
if [[ ! "${ANACONDA_TMP_LABEL}" = "${ANACONDA_LABEL}" ]]
then
anaconda label -o ${ANACONDA_OWNER} --remove ${ANACONDA_TMP_LABEL}
fi
elif [[ "${ANACONDA_RELEASE}" = "finish" ]]
then
if [[ ! "${ANACONDA_TMP_LABEL}" = "${ANACONDA_LABEL}" ]]
then
anaconda label -o ${ANACONDA_OWNER} --copy ${ANACONDA_TMP_LABEL} ${ANACONDA_LABEL}
anaconda label -o ${ANACONDA_OWNER} --remove ${ANACONDA_TMP_LABEL}
fi
fi
set +ev