我有一个操场管道,我正在尝试开始使用 cppcheck,但是当我在 cmd 中执行命令时(我正在运行 Windows 10)它工作正常,但如果在管道内执行命令,它返回'cppcheck' is not recognized as an internal or external command
我已经安装了插件并重新启动詹金斯......那我错过了什么?. 这是示例管道:
pipeline {
agent any
stages {
stage('Static Analysis') {
steps {
script{
env.FAILED_STAGE=env.STAGE_NAME
bat'cppcheck "D:/Source/Game"'
}
}
}
}
}
但是,完全相同的命令,复制并粘贴到 cmd 中,工作得很好,分析文件夹并给我 cppcheck.xml 文件。
此外,如果像这样运行管道,它似乎工作得很好:
stage('Static Analysis') {
steps {
script{
bat'call "C:\\Program Files\\Cppcheck\\cppcheck.exe" D:\\Source\\Game --xml --xml-version=2 . 2> cppcheck.xml'
}
}
}