Convert Yaml stage to Jenkins stage (Build solution)

Viewed 40

I have an old Pipeline that runs in Azure Pipeline, and I need to move it to Jenkins Pipeline but knows nothing about YAML. I need help converting the follwing YAML stage to a Jenkins stage (Groovy), I'ts a build solution stage:

steps:
- task: VSBuild@1
displayName: 'Build solution Acre20.sln'
inputs:
  solution: 'Acre20.sln'
  vsVersion: 16.0
  platform: '$(BuildPlatform)'
  configuration: Debug
  restoreNugetPackages: true
  createLogFile: true

The solution needs to receive arguments of x64 Platform, Visual Studio 2019, and "Debug" Configuration.

Intuitively this is the script I wrote in Jenkins, but the solution doesn't compile (few errors), while it does compile in Azure, so I guess that I wrote it wrong:

stage ('Build solution Acre20.sln'){
        steps{
            script{
                bat """
                Cls
                "${MSBuildPath}\\MSBuild.exe" "${WORKSPACE}\\Acre20.sln" /p:platform="x64" /p:configuration="Debug" /p:VisualStudioVersion="16.0"
                """
            }
        }
    }

Thanks!

0 Answers
Related