Signed-off-by: Hu XueJiao 1034502035@qq.com --- tests/deploy-cci | 52 ++++++++++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 22 deletions(-)
diff --git a/tests/deploy-cci b/tests/deploy-cci index 55835544..8e6acbac 100755 --- a/tests/deploy-cci +++ b/tests/deploy-cci @@ -2,30 +2,38 @@ # SPDX-License-Identifier: MulanPSL-2.0+ # Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved.
-# redirect remote-repository address to "/srv/git/gitee.com" -if [ -n "$GIT_SERVER" ]; then - cat >> /etc/gitconfig <<-EOF - [url "git://$GIT_SERVER/gitee.com"] - insteadOf=https://gitee.com - EOF -fi +export_env() +{ + export initrd_http_host=$INITRD_HTTP_HOST + export initrd_http_port=$INITRD_HTTP_PORT + export gitcache_host=$GITCACHE_HOST + export gitcache_port=$GITCACHE_PORT +}
-export initrd_http_host=$INITRD_HTTP_HOST -export initrd_http_port=$INITRD_HTTP_PORT -export gitcache_host=$GITCACHE_HOST -export gitcache_port=$GITCACHE_PORT +deploy() +{ + # redirect remote-repository address to "/srv/git/gitee.com" + if [ -n "$GIT_SERVER" ]; then + cat >> /etc/gitconfig <<-EOF + [url "git://$GIT_SERVER/gitee.com"] + insteadOf=https://gitee.com + EOF + fi
-mkdir -p /c -cd /c || exit -git clone https://gitee.com/wu_fengguang/compass-ci.git + mkdir -p /c && cd /c + git clone https://gitee.com/wu_fengguang/compass-ci.git
-cd /c/compass-ci || exit -[ -n "$compass_commitid" ] && git reset --hard "$compass_commitid" + cd /c/compass-ci || exit + [ -n "$compass_commit_id" ] && git reset --hard "$compass_commit_id"
-# Need mount tmpfs to fix compass-ci/container/os-nfs/start error -# "exportfs: /exports/result does not support NFS export" -mount -t tmpfs none /srv + # Need mount tmpfs to fix compass-ci/container/os-nfs/start error + # "exportfs: /exports/result does not support NFS export" + mount -t tmpfs none /srv
-# test the script for one-click deployment -cd /c/compass-ci/sparrow || exit -./install-tiny + # test the script for one-click deployment + cd /c/compass-ci/sparrow || exit + ./install-tiny +} + +export_env +deploy
style: extra space in Subject.
Thanks, RenWen
On Wed, Dec 30, 2020 at 06:21:55PM +0800, Hu Xuejiao wrote:
Signed-off-by: Hu XueJiao 1034502035@qq.com
tests/deploy-cci | 52 ++++++++++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 22 deletions(-)
diff --git a/tests/deploy-cci b/tests/deploy-cci index 55835544..8e6acbac 100755 --- a/tests/deploy-cci +++ b/tests/deploy-cci @@ -2,30 +2,38 @@ # SPDX-License-Identifier: MulanPSL-2.0+ # Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved.
-# redirect remote-repository address to "/srv/git/gitee.com" -if [ -n "$GIT_SERVER" ]; then
- cat >> /etc/gitconfig <<-EOF
- [url "git://$GIT_SERVER/gitee.com"]
insteadOf=https://gitee.com
- EOF
-fi +export_env() +{
- export initrd_http_host=$INITRD_HTTP_HOST
- export initrd_http_port=$INITRD_HTTP_PORT
- export gitcache_host=$GITCACHE_HOST
- export gitcache_port=$GITCACHE_PORT
+}
-export initrd_http_host=$INITRD_HTTP_HOST -export initrd_http_port=$INITRD_HTTP_PORT -export gitcache_host=$GITCACHE_HOST -export gitcache_port=$GITCACHE_PORT +deploy() +{
- # redirect remote-repository address to "/srv/git/gitee.com"
- if [ -n "$GIT_SERVER" ]; then
cat >> /etc/gitconfig <<-EOF
[url "git://$GIT_SERVER/gitee.com"]
insteadOf=https://gitee.com
EOF
- fi
-mkdir -p /c -cd /c || exit -git clone https://gitee.com/wu_fengguang/compass-ci.git
- mkdir -p /c && cd /c
- git clone https://gitee.com/wu_fengguang/compass-ci.git
-cd /c/compass-ci || exit -[ -n "$compass_commitid" ] && git reset --hard "$compass_commitid"
- cd /c/compass-ci || exit
- [ -n "$compass_commit_id" ] && git reset --hard "$compass_commit_id"
-# Need mount tmpfs to fix compass-ci/container/os-nfs/start error -# "exportfs: /exports/result does not support NFS export" -mount -t tmpfs none /srv
- # Need mount tmpfs to fix compass-ci/container/os-nfs/start error
- # "exportfs: /exports/result does not support NFS export"
- mount -t tmpfs none /srv
-# test the script for one-click deployment -cd /c/compass-ci/sparrow || exit -./install-tiny
- # test the script for one-click deployment
- cd /c/compass-ci/sparrow || exit
- ./install-tiny
+}
+export_env
+deploy
2.23.0