gpt4 book ai didi

jenkins - 将 shell 变量发送到 jenkins 作业中的松弛通知

转载 作者:行者123 更新时间:2023-12-05 06:25:23 25 4
gpt4 key购买 nike

我有一个执行部署的 shell 脚本。我的 shell 脚本中设置了一个变量,我想在松弛通知自定义消息中传递该变量,但它没有按预期工作。

我已经使用 envInject 插件将 shell 变量设置为环境变量,但它没有按预期工作

${CRQ} is completed in staging. Please validate
Console url is : ${BUILD_URL}console

staging_daily_dose - #114 4.4 秒后失败(打开)

Console url is  : https://jenkins-host/job/staging_daily_dose/114/console``` 

I want ${CRQ} with the actual value. Can someone help me with the best approach

最佳答案

从各种帖子中可以清楚地看到,要添加一个可以被 Slack Notification Plugin 使用的环境变量,需要使用 Inject Environment Variable 来插入,所以

  1. 在构建步骤中创建一个属性文件并写入所需的变量,并在注入(inject)环境变量插件中使用该文件

enter image description here

  1. 接下来使用 Slack 通知插件中的变量 enter image description here

这将导致如下所示的松弛消息。 enter image description here

关于jenkins - 将 shell 变量发送到 jenkins 作业中的松弛通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57176739/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com