[why] when call simplify-ci individually to deploy environment, SCHED_HOST, SCHED_PORT, GIT_SERVER, these variables are undefined in a very clean machine, execute the script will failed, so set default values is necessary.
Signed-off-by: Liu Yinsi liuyinsi@163.com --- setup/simplify-ci | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/setup/simplify-ci b/setup/simplify-ci index e3ee3f772..df18272f3 100755 --- a/setup/simplify-ci +++ b/setup/simplify-ci @@ -2,8 +2,18 @@ # SPDX-License-Identifier: MulanPSL-2.0+ # Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved.
+: ${SCHED_HOST:=172.17.0.1} +: ${SCHED_PORT:=3000} + git_ci() { + if [ -n "$GIT_SERVER" ]; then + cat >> /etc/gitconfig <<-EOF + [url "git://$GIT_SERVER/gitee.com"] + insteadOf=https://gitee.com + EOF + fi + git clone git://$GIT_SERVER/gitee.com/wu_fengguang/compass-ci.git /c/compass-ci }