1

I'm trying to configure Squirrel to work with Jenkins.. I've a simple project (created just for test) that only shows build number.

I've set up jenkins as

enter image description here

How do I tell that it has to take the version inside the assembly.cs? and how do I pass that information to the squirrel command?

Thanks

Community
  • 1
  • 1
advapi
  • 3,661
  • 4
  • 38
  • 73

1 Answers1

0

I have no experience with Jenkins, but this is what I do in my post build script. The version is passed via the @(VersionNumber) parameter to a powershell script which the modifies the .nuspec file. I would assume you may have to do something similar before you call the Execute Windows Batch Command function to releasify your app.

Visual Studio Post-build event command line

if $(ConfigurationName) ==Release "C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -ExecutionPolicy RemoteSigned -file "$(ProjectDir)\"PostBuild.ps1 "$(ProjectDir) " @(VersionNumber)

PostBuild.ps1

param (
[string]$ProjectDir,
[string]$Revision
)

    #write new version to nuspec
    $nuspec_file_name = "Package.nuspec"

    $nuspec_file_path = "$ProjectDir$nuspec_file_name"
    Write-Host "nuspec file: $nuspec_file_path"
    [xml]$nuspec_xml = Get-Content($nuspec_file_path)
    $nuspec_xml.package.metadata.version = $Revision
    $nuspec_xml.Save($nuspec_file_path)
colinwurtz
  • 703
  • 1
  • 7
  • 23