代码之家  ›  专栏  ›  技术社区  ›  David O'Brien

服务结构-在不更改代码的情况下部署新版本的应用程序

  •  0
  • David O'Brien  · 技术社区  · 6 年前

    在服务结构中是否有一种方法可以部署应用程序的新版本,即使代码没有更改?
    每当开发人员重新构建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中,设置了“服务结构应用程序部署”任务的“使用diff包”选项。

    1 回复  |  直到 6 年前
        1
  •  0
  •   Diego Mendes    6 年前

    这个已经回答了 here here

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

    回答主要问题:

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