在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
产品构建、打包、部署完需要发送邮件通知相关人员进行验证。请看过程 #encoding:utf-8 require 'mail' #~ branch = ARGV.to_s.sub('[','').sub(']','') # host = '10.0.2.44' # port = '215' # version = 'v2.1.6.1024' # productPath = '\\10.0.2.44\public\shench\CrowdPackage\v2.1.5\20161209135558' host = ARGV[0] port = ARGV[1] version = ARGV[2] productPath = ARGV[3] notesPath = '/home/CrowdProduct/releaseNotes.txt' smtp = { :address => 'smtp.exmail.qq.com', :port => '25', :domain => 'xxxxxxxx.com', :user_name => '[email protected]', :password => 'xxxxxxx', :enable_starttls_auto => true, :openssl_verify_mode => 'none' } Mail.defaults { delivery_method :smtp, smtp } puts "start send mail" mail = Mail.new do from '[email protected]' to 'xxxx,xxxx' subject "【crowdProduct】【#{version}】Product build complete, please test." body " product path: #{productPath} web site: http:\//#{host}:#{port}\n 【release notes】 #{File.readlines(notesPath).join}" end mail.deliver! puts "mail done"
发送的邮件内容从该文件获取:notesPath = '/home/CrowdProduct/releaseNotes.txt' 下一节将教你如何获取git commit 信息,规整后作为release notes
收到的邮件效果如下: 测试人员收到邮件后,直接登录web页面即可测试
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论