Signed-off-by: Hu XueJiao 1034502035@qq.com --- tests/deploy-cci | 53 ++++++++++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 22 deletions(-)
diff --git a/tests/deploy-cci b/tests/deploy-cci index 55835544..21308ecf 100755 --- a/tests/deploy-cci +++ b/tests/deploy-cci @@ -2,30 +2,39 @@ # 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 +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 || exit + 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_commitid" ] && git reset --hard "$compass_commitid"
-# 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 +} + +env +deploy
On Tue, Dec 29, 2020 at 12:03:44PM +0800, Hu Xuejiao wrote:
Signed-off-by: Hu XueJiao 1034502035@qq.com
tests/deploy-cci | 53 ++++++++++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 22 deletions(-)
diff --git a/tests/deploy-cci b/tests/deploy-cci index 55835544..21308ecf 100755 --- a/tests/deploy-cci +++ b/tests/deploy-cci @@ -2,30 +2,39 @@ # 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 +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 || exit
mv '|| exit' after command 'mkdir' is better if you are worrying about directory creation failing and avoid printing the failure message, use: mkdir -p /c 2&> /dev/null || exit
Thanks, Luan Shengde
-cd /c/compass-ci || exit -[ -n "$compass_commitid" ] && git reset --hard "$compass_commitid"
- cd /c/compass-ci || exit
- [ -n "$compass_commitid" ] && git reset --hard "$compass_commitid"
-# 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
+}
+env
+deploy
2.23.0