【问题标题】:Service Fabric - Deploy new version of app without code changesService Fabric - 无需更改代码即可部署新版本的应用
【发布时间】:2018-11-14 06:03:16
【问题描述】:

Service Fabric 中是否有一种方法可以部署新版本的应用,即使代码没有更改?
每当开发人员重建 repo 时,SF 就会不断抱怨这一点,因为包外的某些内容发生了变化,但并未更改应用程序的实际代码,并且应用程序的版本被构建管道提高了。
SF 然后说“您正在尝试部署已存在的较新版本的应用程序,即使没有更改代码”,然后失败。
有什么办法可以改变这种行为?


编辑:

这是实际部署错误的跟踪:

2018-11-07T06:07:23.1289545Z ##[debug]Processed: ##vso[telemetry.publish 

area=TaskHub;feature=ServiceFabricDeploy]{"OperationId":"GetApplicationType","ExceptionData":"System.Management.Automation.MethodInvocationException;System.Management.Automation.RuntimeException;System.Management.Automation.RuntimeException;|D:\\a\\_tasks\\ServiceFabricDeploy_c6650aa0-185b-11e6-a47d-df93e7a34c64\\1.7.27\\ServiceFabricSDK\\Utilities.ps1|597","JobId":"ae65e85b-a04b-4de4-ac32-c9a821fba222","SDKVersion":"3.2.176.9494"}
2018-11-07T06:07:23.5491048Z ##[debug]Leaving D:\a\_tasks\ServiceFabricDeploy_c6650aa0-185b-11e6-a47d-df93e7a34c64\1.7.27\deploy.ps1.
2018-11-07T06:07:23.5537752Z ##[debug]Caught exception from task script.
2018-11-07T06:07:23.5570190Z ##[debug]Error record:
2018-11-07T06:07:23.6347435Z ##[debug]Invoke-ActionWithRetries : Exception calling "Invoke" with "1" argument(s): "Failed to register application type. Status: Failed. Details: FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR: The content in CodePackage Name:Code and Version:1.0.0.18275.02 in Service Manifest 'App.ApiGateway.WebApiPkg' has changed, but the version number is the same.."
2018-11-07T06:07:23.6359357Z ##[debug]At D:\a\_tasks\ServiceFabricDeploy_c6650aa0-185b-11e6-a47d-df93e7a34c64\1.7.27\ServiceFabricSDK\Utilities.ps1:597 char:12
2018-11-07T06:07:23.6371643Z ##[debug]+     return Invoke-ActionWithRetries -Action $getAppTypeAction `
2018-11-07T06:07:23.6383668Z ##[debug]+            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2018-11-07T06:07:23.6395763Z ##[debug]    + CategoryInfo          : NotSpecified: (:) [Invoke-ActionWithRetries], MethodInvocationException
2018-11-07T06:07:23.6408095Z ##[debug]    + FullyQualifiedErrorId : RuntimeException,Invoke-ActionWithRetries
2018-11-07T06:07:23.6420176Z ##[debug] 
2018-11-07T06:07:23.6439430Z ##[debug]Script stack trace:
2018-11-07T06:07:23.6475478Z ##[debug]at Invoke-ActionWithRetries, D:\a\_tasks\ServiceFabricDeploy_c6650aa0-185b-11e6-a47d-df93e7a34c64\1.7.27\ps_modules\PowershellHelpers\Helpers.ps1: line 61
2018-11-07T06:07:23.6487812Z ##[debug]at Wait-ServiceFabricApplicationTypeRegistrationStatus, D:\a\_tasks\ServiceFabricDeploy_c6650aa0-185b-11e6-a47d-df93e7a34c64\1.7.27\ServiceFabricSDK\Utilities.ps1: line 597
2018-11-07T06:07:23.6500061Z ##[debug]at Register-ServiceFabricApplicationTypeAction, D:\a\_tasks\ServiceFabricDeploy_c6650aa0-185b-11e6-a47d-df93e7a34c64\1.7.27\ServiceFabricSDK\Utilities.ps1: line 516
2018-11-07T06:07:23.6512541Z ##[debug]at Publish-NewServiceFabricApplication, D:\a\_tasks\ServiceFabricDeploy_c6650aa0-185b-11e6-a47d-df93e7a34c64\1.7.27\ServiceFabricSDK\Publish-NewServiceFabricApplication.ps1: line 296
2018-11-07T06:07:23.6524254Z ##[debug]at <ScriptBlock>, D:\a\_tasks\ServiceFabricDeploy_c6650aa0-185b-11e6-a47d-df93e7a34c64\1.7.27\deploy.ps1: line 194
2018-11-07T06:07:23.6536298Z ##[debug]at <ScriptBlock>, <No file>: line 1
2018-11-07T06:07:23.6548158Z ##[debug]at <ScriptBlock>, <No file>: line 22
2018-11-07T06:07:23.6559801Z ##[debug]at <ScriptBlock>, <No file>: line 18
2018-11-07T06:07:23.6572215Z ##[debug]at <ScriptBlock>, <No file>: line 1
2018-11-07T06:07:23.6591191Z ##[debug]Exception:
2018-11-07T06:07:23.6634400Z ##[debug]System.Management.Automation.MethodInvocationException: Exception calling "Invoke" with "1" argument(s): "Failed to register application type. Status: Failed. Details: FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR: The content in CodePackage Name:Code and Version:1.0.0.18275.02 in Service Manifest 'App.ApiGateway.WebApiPkg' has changed, but the version number is the same.." ---> System.Management.Automation.RuntimeException: Failed to register application type. Status: Failed. Details: FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR: The content in CodePackage Name:Code and Version:1.0.0.18275.02 in Service Manifest 'App.ApiGateway.WebApiPkg' has changed, but the version number is the same.. ---> System.Management.Automation.RuntimeException: Failed to register application type. Status: Failed. Details: FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR: The content in CodePackage Name:Code and Version:1.0.0.18275.02 in Service Manifest 'App.ApiGateway.WebApiPkg' has changed, but the version number is the same..
2018-11-07T06:07:23.6646133Z ##[debug]   --- End of inner exception stack trace ---
2018-11-07T06:07:23.6657929Z ##[debug]   at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
2018-11-07T06:07:23.6670688Z ##[debug]   at <ScriptBlock>(Closure , FunctionContext )
2018-11-07T06:07:23.6683139Z ##[debug]   at System.Management.Automation.ScriptBlock.InvokeWithPipeImpl(ScriptBlockClauseToInvoke clauseToInvoke, Boolean createLocalScope, Dictionary`2 functionsToDefine, List`1 variablesToDefine, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Object[] args)
2018-11-07T06:07:23.6694796Z ##[debug]   at System.Management.Automation.ScriptBlock.<>c__DisplayClass57_0.<InvokeWithPipe>b__0()
2018-11-07T06:07:23.6707020Z ##[debug]   at System.Management.Automation.Runspaces.RunspaceBase.RunActionIfNoRunningPipelinesWithThreadCheck(Action action)
2018-11-07T06:07:23.6719153Z ##[debug]   at System.Management.Automation.ScriptBlock.InvokeWithPipe(Boolean useLocalScope, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Boolean propagateAllExceptionsToTop, List`1 variablesToDefine, Dictionary`2 functionsToDefine, Object[] args)
2018-11-07T06:07:23.6731325Z ##[debug]   at System.Management.Automation.ScriptBlock.DoInvoke(Object dollarUnder, Object input, Object[] args)
2018-11-07T06:07:23.6742915Z ##[debug]   at CallSite.Target(Closure , CallSite , ScriptBlock , Object )
2018-11-07T06:07:23.6754590Z ##[debug]   --- End of inner exception stack trace ---
2018-11-07T06:07:23.6766838Z ##[debug]   at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
2018-11-07T06:07:23.6778543Z ##[debug]   at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
2018-11-07T06:07:23.6791071Z ##[debug]   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
2018-11-07T06:07:23.6802711Z ##[debug]   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
2018-11-07T06:07:23.6814797Z ##[debug]   at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)
2018-11-07T06:07:23.6826406Z ##[debug]   at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
2018-11-07T06:07:23.6838645Z ##[debug]   at System.Management.Automation.PSScriptCmdlet.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess)
2018-11-07T06:07:23.6850253Z ##[debug]   at System.Management.Automation.PSScriptCmdlet.DoEndProcessing()
2018-11-07T06:07:23.6862534Z ##[debug]   at System.Management.Automation.CommandProcessorBase.Complete()
2018-11-07T06:07:23.6921240Z ##[error]Exception calling "Invoke" with "1" argument(s): "Failed to register application type. Status: Failed. Details: FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR: The content in CodePackage Name:Code and Version:1.0.0.18275.02 in Service Manifest 'App.ApiGateway.WebApiPkg' has changed, but the version number is the same.."

在 AzDo / VSTS 中,设置了“Service Fabric 应用程序部署”任务上的“使用差异包”选项。

【问题讨论】:

标签: azure-service-fabric


【解决方案1】:

这已经回答here和here

你应该改成differencial packaging,或者更新所有服务的版本。

回答主要问题:

不,无法更改此行为,您必须更新版本或进行差异打包。

【讨论】:

  • 其实管道已经配置为“使用差异包”。所以可能不是这样。
  • stackoverflow.com/a/34886586/484222 ,来自文档 > “当您有一个直接从应用程序构建过程生成构建布局的部署系统时,即使代码没有更改,新构建的程序集也会得到不同的校验和。使用完整的应用程序包将需要您更新所有代码包的版本。使用差异包,您只提供更改的文件和版本更改的清单文件。"
猜你喜欢
  • 2023-04-03
  • 2018-09-05
  • 2021-09-14
  • 1970-01-01
  • 2019-11-07
  • 2017-02-24
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多