【问题标题】:Jenkins how to execute particular shell command from the git commit messageJenkins 如何从 git commit 消息中执行特定的 shell 命令
【发布时间】:2026-02-14 20:50:02
【问题描述】:

我有 3 个测试命令要在构建后运行,但我想根据 git 提交消息中的关键字运行这些命令。

Commit message: 'New changes [CoreTest]'

if(CoreTest){
   Run coreTest shell command for spoon
}else if(CloudTest){
   Run CloudTest shell command for spoon
}
else{
   AllTests shell command for spoon
}

【问题讨论】:

    标签: git jenkins jenkins-plugins spoon commit-message


    【解决方案1】:

    尝试parametrized plugin 完成这项工作

    (传递Coretest值作为参数)

    【讨论】: