add login command for account VM server. case forwarded user info has key account_vm with value: yes/true, the email will send the login command.
Signed-off-by: Luan Shengde shdluan@163.com --- .../mail-robot/lib/assign-account-email.rb | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/container/mail-robot/lib/assign-account-email.rb b/container/mail-robot/lib/assign-account-email.rb index b71b3fe..2171de7 100755 --- a/container/mail-robot/lib/assign-account-email.rb +++ b/container/mail-robot/lib/assign-account-email.rb @@ -3,13 +3,26 @@ # Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. # frozen_string_literal: true
-def build_apply_account_email(my_info) +def build_apply_account_email(my_info, account_info, assign_account_vm) email_greeting = if my_info['bisect'] 'We have automatically created the following information for you.' else 'Thank you for joining us.' end
+ login_msg = <<~LOGIN_MSG + + You can use the following command to login the jumper server: + + Login command: + ssh -p #{account_info['jumper_port']} #{account_info['my_login_name']}@#{account_info['jumper_host']} + + Account password: + #{account_info['my_password']} + LOGIN_MSG + + login_account_vm = assign_account_vm ? login_msg : '' + email_msg = <<~EMAIL_MESSAGE To: #{my_info['my_email']} Subject: [compass-ci] Account Ready @@ -17,8 +30,8 @@ def build_apply_account_email(my_info) Dear #{my_info['my_name']},
#{email_greeting} - - You can use the following info to submit jobs: + #{login_account_vm} + You need to do the following configurations before submitting a job:
notice: (1-2) are ONE-TIME setup