sample: mail-job crystal.92144 Date: Mon, Oct 12 2020 17:30:56PM +0800 From: team@crystal.ci To: lwt@crystal.ci Subject: [Compass-ci] job: crystal.92144 result
Hi, Thanks for your participation in Kunpeng and software ecosystem! Your Job: crystal.92144 had finished. Please check job result: http://172.17.0.1:11300/result/iperf/vm-hi1620-2p8g--lwt/2020-10-12/crystal....
Regards Compass-ci https://gitee.com/openeuler/compass-ci
Signed-off-by: Lu Weitao luweitaobe@163.com --- lib/constants.rb | 3 +++ lib/mail_job_result.rb | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/lib/constants.rb b/lib/constants.rb index 3a4f083..5c42466 100644 --- a/lib/constants.rb +++ b/lib/constants.rb @@ -10,3 +10,6 @@ ES_PORT = config['ES_PORT'] || 9200
MAIL_HOST = config['MAIL_HOST'] || '172.17.0.1' MAIL_PORT = config['MAIL_PORT'] || 11_311 + +SRV_HTTP_HOST = config['SRV_HTTP_HOST'] || ENV['SRV_HTTP_HOST'] || '172.17.0.1' +SRV_HTTP_PORT = config['SRV_HTTP_PORT'] || ENV['SRV_HTTP_PORT'] || 11_300 diff --git a/lib/mail_job_result.rb b/lib/mail_job_result.rb index 9202b81..29a9c1a 100644 --- a/lib/mail_job_result.rb +++ b/lib/mail_job_result.rb @@ -9,8 +9,10 @@ require 'json'
# compose and send email for job result class MailJobResult - def initialize(job_id) + def initialize(job_id, result_host = SRV_HTTP_HOST, result_port = SRV_HTTP_PORT) @job_id = job_id + @result_host = result_host + @result_port = result_port end
def send_mail @@ -25,7 +27,7 @@ class MailJobResult body = "Hi, Thanks for your participation in Kunpeng and software ecosystem! Your Job: #{@job_id} had finished. - Please check job result: \n\n#{signature}" + Please check job result: http://#%7B@result_host%7D:#%7B@result_port%7D#%7B@result_root%7D%5Cn%5Cn#%7..." { 'to' => @submitter_email, 'body' => body, 'subject' => subject } end
@@ -34,6 +36,7 @@ class MailJobResult exit unless job['email']
@submitter_email = job['email'] + @result_root = job['result_root'] end
def query_job
On Tue, Oct 13, 2020 at 05:36:00PM +0800, Lu Weitao wrote:
sample: mail-job crystal.92144 Date: Mon, Oct 12 2020 17:30:56PM +0800 From: team@crystal.ci To: lwt@crystal.ci Subject: [Compass-ci] job: crystal.92144 result
Hi, Thanks for your participation in Kunpeng and software ecosystem! Your Job: crystal.92144 had finished. Please check job result: http://172.17.0.1:11300/result/iperf/vm-hi1620-2p8g--lwt/2020-10-12/crystal....
Regards Compass-ci https://gitee.com/openeuler/compass-ci
Signed-off-by: Lu Weitao luweitaobe@163.com
lib/constants.rb | 3 +++ lib/mail_job_result.rb | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/lib/constants.rb b/lib/constants.rb index 3a4f083..5c42466 100644 --- a/lib/constants.rb +++ b/lib/constants.rb @@ -10,3 +10,6 @@ ES_PORT = config['ES_PORT'] || 9200
MAIL_HOST = config['MAIL_HOST'] || '172.17.0.1' MAIL_PORT = config['MAIL_PORT'] || 11_311
+SRV_HTTP_HOST = config['SRV_HTTP_HOST'] || ENV['SRV_HTTP_HOST'] || '172.17.0.1' +SRV_HTTP_PORT = config['SRV_HTTP_PORT'] || ENV['SRV_HTTP_PORT'] || 11_300
Is here 11_300 a clerical error?
On Tue, Oct 13, 2020 at 08:19:14PM +0800, Xu Xijian wrote:
On Tue, Oct 13, 2020 at 05:36:00PM +0800, Lu Weitao wrote:
sample: mail-job crystal.92144 Date: Mon, Oct 12 2020 17:30:56PM +0800 From: team@crystal.ci To: lwt@crystal.ci Subject: [Compass-ci] job: crystal.92144 result
Hi, Thanks for your participation in Kunpeng and software ecosystem! Your Job: crystal.92144 had finished. Please check job result: http://172.17.0.1:11300/result/iperf/vm-hi1620-2p8g--lwt/2020-10-12/crystal....
Regards Compass-ci https://gitee.com/openeuler/compass-ci
Signed-off-by: Lu Weitao luweitaobe@163.com
lib/constants.rb | 3 +++ lib/mail_job_result.rb | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/lib/constants.rb b/lib/constants.rb index 3a4f083..5c42466 100644 --- a/lib/constants.rb +++ b/lib/constants.rb @@ -10,3 +10,6 @@ ES_PORT = config['ES_PORT'] || 9200
MAIL_HOST = config['MAIL_HOST'] || '172.17.0.1' MAIL_PORT = config['MAIL_PORT'] || 11_311
+SRV_HTTP_HOST = config['SRV_HTTP_HOST'] || ENV['SRV_HTTP_HOST'] || '172.17.0.1' +SRV_HTTP_PORT = config['SRV_HTTP_PORT'] || ENV['SRV_HTTP_PORT'] || 11_300
Is here 11_300 a clerical error?
Yeah let's use 11300.
Thanks, Fengguang
On Tue, Oct 13, 2020 at 08:21:20PM +0800, Wu Fengguang wrote:
On Tue, Oct 13, 2020 at 08:19:14PM +0800, Xu Xijian wrote:
On Tue, Oct 13, 2020 at 05:36:00PM +0800, Lu Weitao wrote:
sample: mail-job crystal.92144
+SRV_HTTP_HOST = config['SRV_HTTP_HOST'] || ENV['SRV_HTTP_HOST'] || '172.17.0.1' +SRV_HTTP_PORT = config['SRV_HTTP_PORT'] || ENV['SRV_HTTP_PORT'] || 11_300
Is here 11_300 a clerical error?
Yeah let's use 11300.
ok, got it
Thanks, Weitao
Thanks, Fengguang
MAIL_HOST = config['MAIL_HOST'] || '172.17.0.1' MAIL_PORT = config['MAIL_PORT'] || 11_311
+SRV_HTTP_HOST = config['SRV_HTTP_HOST'] || ENV['SRV_HTTP_HOST'] || '172.17.0.1' +SRV_HTTP_PORT = config['SRV_HTTP_PORT'] || ENV['SRV_HTTP_PORT'] || 11_300
Is here 11_300 a clerical error?
older rubocop require 11300 => 11_300 now, we can write as 11300.
Thanks, Weitao