2016-11-23 104 views
1

我想配置松鼠与詹金斯一起工作..我有一个简单的项目(只为测试创建),只显示内部版本号。设置松鼠与詹金斯

我已经设置了詹金斯为

enter image description here

我怎么告诉它必须采取assembly.cs里面的版本?以及如何将这些信息传递给松鼠命令?

感谢

回答

0

我有詹金斯没有经验,但是这是我在我的帖子构建脚本做。该版本通过@(VersionNumber)参数传递给修改.nuspec文件的powershell脚本。我想你可能需要做类似的事情,然后再调用Execute Windows Batch Command函数来释放你的应用程序。

的Visual Studio生成后事件命令行

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)