如何将 Allure html 报告从 GitLab 作业发送到电子邮件

问题描述 投票:0回答:0

我正在尝试将 Allure html 报告从 GitLab 工作发送到电子邮件。我尝试将“电子邮件”步骤添加到我的报告作业中,但收到错误消息:“.yaml-schema 中不允许使用属性电子邮件”。还有其他方法可以自动将报告发送到电子邮件吗?这些是我运行测试和创建报告的工作:

run_Tests_Dev:
  stage: test
  script:
    - npm install
    - npx browserslist@latest --update-db
    - npm ci
    - npm run start:ci &
    - npm run Dev || FAILED=true
  when: always
  artifacts:
    name: "web-aqa-report"
    paths:
      - allure-results
      - allure-report
      - screenshots

report_Dev:
  image: timbru31/java-node:8-jdk-gallium
  stage: reporting
  before_script:
    - npm install -g allure-commandline --save-dev
  needs:
    - run_Tests_Dev
  dependencies:
    - run_Tests_Dev
  script:
    - npm run allure:report
  when: always
  artifacts:
    name: "web-aqa-report"
    paths:
      - allure-results
      - allure-report
      - screenshots
  email:
    recipients:
      - [email protected]
    subject: "Allure report for project X"
    body: "Please find attached the Allure report for project X"
    attachments:
      - allure-report/index.html```

I was trying adding this step to my report job
```email:
    recipients:
      - [email protected]
    subject: "Allure report for project X"
    body: "Please find attached the Allure report for project X"
    attachments:
      - allure-report/index.html```
This triggered error: "Property email is not allowed in .yaml-schema".
Also `--send-to ` triggered error "Unaccepted method"
I expect to send html report to an email after job passed.
email gitlab-ci gitlab-ci-runner allure gitlab-ci.yml
© www.soinside.com 2019 - 2024. All rights reserved.