Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jenkins 安排松鼠和詹金斯一起工作_Jenkins_Squirrel.windows - Fatal编程技术网

Jenkins 安排松鼠和詹金斯一起工作

Jenkins 安排松鼠和詹金斯一起工作,jenkins,squirrel.windows,Jenkins,Squirrel.windows,我正在尝试配置Squirrel与Jenkins一起工作。。我有一个简单的项目(为测试而创建),它只显示构建编号 我把詹金斯安排成 我如何判断它必须在assembly.cs中获取版本?我如何将这些信息传递给squirrel命令 谢谢我对Jenkins没有经验,但这就是我在构建后脚本中所做的。版本通过@(VersionNumber)参数传递给powershell脚本,该脚本修改.nuspec文件。在调用executewindows批处理命令函数来重新简化应用程序之前,我假设您可能需要执行类似的操作

我正在尝试配置Squirrel与Jenkins一起工作。。我有一个简单的项目(为测试而创建),它只显示构建编号

我把詹金斯安排成

我如何判断它必须在assembly.cs中获取版本?我如何将这些信息传递给squirrel命令


谢谢

我对Jenkins没有经验,但这就是我在构建后脚本中所做的。版本通过
@(VersionNumber)
参数传递给powershell脚本,该脚本修改
.nuspec
文件。在调用
executewindows批处理命令
函数来重新简化应用程序之前,我假设您可能需要执行类似的操作

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)

我没有使用Jenkins的经验,但这就是我在构建后脚本中所做的。版本通过
@(VersionNumber)
参数传递给powershell脚本,该脚本修改
.nuspec
文件。在调用
executewindows批处理命令
函数来重新简化应用程序之前,我假设您可能需要执行类似的操作

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)