+# SPDX-License-Identifier: MulanPSL-2.0+ +# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. +# export config info setup.yaml server_ip, my_email, my_name.
+mkdir -p /etc/compass-ci/ +cp -a $CCI_SRC/sparrow/setup.yaml /etc/compass-ci/setup.yaml
+options=( server_ip my_name my_email )
+for option in ${options[@]} +do
- export $option=$(grep "^$option:" /etc/compass-ci/setup.yaml |awk -F ": " '{print $2}')
export is a disposable config for variable, it take effect just for the login this time. for the next login, it will in failure. if you want to use it all the time, add 'export my_email|my_name|server_ip' to user's default profile. and source it for current login.
for the line above, use awk if enough, no need 'grep--awk', like: export $option=$(awk -F ": " '/^'$option'/ {print $2}' /etc/compass-ci/setup.yaml)
Thanks, Luan Shengde
+done
2.23.0