On Mon, Feb 08, 2021 at 09:01:05AM +0800, Cao Xueliang wrote:
On Sun, Feb 07, 2021 at 08:20:24PM +0800, Liu Yinsi wrote:
[error] root@taishan200-2280-2s64p-256g--a9 /c/compass-ci/container/register-accounts# ./start
refer code: /c/compass-ci/sbin/build-my-info.rb: ... option = { 'my_email' => `git config --global user.email`.chomp, 'my_name' => `git config --global user.name`.chomp, 'lab' => `awk '/^lab:\s/ {print $2; exit}' /etc/compass-ci/defaults/*.yaml`.chomp } ... build_my_info(option) ...
[why] in a new running container environment, not exists git config (user email, user name) and config yaml (/etc/compass-ci/defaults/*.yaml), so option is empty, then failed to register account.
Why is there no such config yaml, it should be created in sparrow.
in a new start container, we not bind mount /etc/compass-ci/defaults/*.yaml, so no such file in container.
and we no need to mount such file, because we just use /etc/compass-ci/register/*.yaml
Thanks, Yinsi
Thanks, Xueliang
the purpose that require build-my-info.rb, is not execute build-my-info.rb script, we just want to call function build_my_info().
[how] when sbin/build-my-info.rb is not executed independently but invoked by other files, avoid to execute function build_my_info().
Signed-off-by: Liu Yinsi liuyinsi@163.com
sbin/build-my-info.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sbin/build-my-info.rb b/sbin/build-my-info.rb index dbe093d..098189a 100755 --- a/sbin/build-my-info.rb +++ b/sbin/build-my-info.rb @@ -52,4 +52,6 @@ def build_my_info(option) build_my_info.config_my_info(info_es) end
-build_my_info(option) +if $PROGRAM_NAME == __FILE__
- build_my_info(option)
+end
2.23.0