Skip to content

Latest commit

 

History

History
52 lines (42 loc) · 1.23 KB

allure-docker-serviceのEmailableReportをHTMLメールとして送信する.adoc

File metadata and controls

52 lines (42 loc) · 1.23 KB
title date draft tags
allure-docker-serviceのEmailableReportをHTMLメールとして送信する
2022-10-17 07:42:00 +0900
false
juice
Allure
Allure Report
jq
Amazon SES

allure-docker-serviceのEmailableReportをHTMLメールとして送信する

EmailableReportのHTMLはcssを外部から取得する形になっている。
それではHTML形式のメールとして送れないためjuiceを使用してinline化しAmazonSESで送信する。

準備

以下2ファイル準備する。

  • AWSCLIで送るためのmessageオプションのJSON

    message.json
    link:message.json[role=include]
  • レポートのHTML

    report.html
    link:report.html[role=include]

実行

juiceでインライン化しSESで送信(Bash)
docker run -v ${PWD}:/work node:18.11.0-alpine3.16 npx juice /work/report.html /work/inline_report.html
fromMailAddress=szk302@example.com
toMailAddress=szk302@example.com
jq '.Body.Html.Data |=$value' --rawfile value ./inline_report.html ./message.json > body.json
aws ses send-email --to "${toMailAddress}" --from "${fromMailAddress}" --message file://body.json