Hello,

I use bat command in Jenkins pipeline which launches MSBUild. But the 
parameter used namely "buildconfiguration" is not expanded. You may ignore 
error solution file not found. What I want to use the command executed the 
value of varibale "buildconfiguration"

Anyone has a solution for this.

Thanks in advance.

Best Regards !



Pipeline code
---------------

def buildconfiguration = 'Debug'

node('master')
{
  stage('one')
  {
    bat '"%ProgramFiles(x86)%\\MSbuild\\14.0\\bin\\MSBuild.exe" 
Tools\\MailboxRefill\\Mailbox.sln 
/property:Configuration=${buildconfiguration} /target:Build /nologo 
/clp:ErrorsOnly /verbosity:minimal /p:RunCodeAnalysis=false 
/p:WarningLevel=1'
  }     
    
}



Output
----------
Started by user admin
[Pipeline] node
Running on master in D:\Software\Z-Tools\TestPipeline
[Pipeline] {
[Pipeline] stage
[Pipeline] { (one)
[Pipeline] bat
[TestPipeline] Running batch script

D:\Software\Z-Tools\TestPipeline>"C:\Program Files 
(x86)\MSbuild\14.0\bin\MSBuild.exe" Tools\MailboxRefill\Mailbox.sln 
/property:Configuration=${buildconfiguration} /target:Build /nologo 
/clp:ErrorsOnly /verbosity:minimal /p:RunCodeAnalysis=false 
/p:WarningLevel=1 
MSBUILD : error MSB1009: Project file does not exist.
Switch: Tools\MailboxRefill\Mailbox.sln
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 1
Finished: FAILURE


-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/e04e0215-6a40-4ffc-9385-722f14ac0c85%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to