【发布时间】:2020-04-29 08:54:58
【问题描述】:
我正在尝试设置 GitLab CI 配置,该配置在管道作业完成后发送一封电子邮件,其中包含指向上传站点的工件链接。该管道基于 pom.xml 构建,然后使用 sonarqube 进行测试,然后使用 curl 将工件上传到特定的工件位置。工件目录的文件夹结构和链接取决于 CI_PIPELINE_ID。在所有这些都成功之后,我需要通过邮件将此用于下载工件的链接发送到人员列表。我的 .gitlab-config.yml 如下所示:
image: maven:3.3.9-jdk-8
variables:
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
MAVEN_CLI_OPTS: "-U --batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
REPO_NAME: "<artifactory url>"
cache:
paths:
- .m2/repository
- ./target/
stages:
- build
compile_commit:
stage: build
only:
- cr_integrate
before_script:
- git submodule sync --recursive
- git submodule update --init --recursive --remote
script:
- mvn -f pom.xml -s settings.xml $MAVEN_CLI_OPTS clean install $MAVEN_OPTS
- curl -i -u<username>:<token> -T "target/<artifact-1>.zip" "${REPO_NAME}/${CI_PIPELINE_ID}/<artifact-1>.zip"
- curl -i -u<username>:<token> -T "target/<artifact-1>.zip" "${REPO_NAME}/${CI_PIPELINE_ID}/<artifact-2>.zip"
- - curl -i -u<username>:<token> -T "target/<artifact-1>.zip" "${REPO_NAME}/${CI_PIPELINE_ID}/<artifact-3>.zip"
tags:
- <tagname>
在此之后如何通过链接向某些人发送邮件?
【问题讨论】:
标签: continuous-integration gitlab gitlab-ci pipeline