Setting up a Pipeline build in Jenkins (Jenkins 2.6), copying the sample script for a git-based build gives: "no tool named MSBuild found". I have set MSBuild Tool in Manage Jenkins -> Global Tool Configuration
. I am running pipeline on the agent node.
In the agent configuration, I have set MSBuild tool path in Node Properties -> Tool Locations
.
While build process it is not able to get MSBuild tool path, if i run same source without pipeline (without using Jenkinsfile) it works fine.
Please see Jenkinsfile Syntax
pipeline {
agent { label 'win-agent-node' }
stages {
stage('build') {
steps {
bat "\"${tool 'MSBuild'}\" SimpleWindowsProject.sln /t:Rebuild /p:Configuration=Release"
}
}
}
}
I have also tried to change environment variable for windows agent it not refreshed.
NOTE: I have installed MS Build tool for on agent node
MSBuild
? You have it referenced one I'm above as "MBuild", without an S. – Clammy