简体   繁体   English

Package 部署人员对解决方案和数据文件进行排序

[英]Package Deployer to sequence Solutions and Data File

Working on Package Deployer Project to deploy Managed Solutions and Data Files in Sequence.致力于 Package 部署项目,以按顺序部署托管解决方案和数据文件。

I have added 3 solutions and 1 Data file(Data file created using the Configuration Migration tool which comes with CRM SDK) in PkgFolder.我在PkgFolder中添加了3个解决方案和1个数据文件(使用CRM SDK附带的配置迁移工具创建的数据文件)。 I have added 3 solutions and a Data file in ImportConfig.xml我在 ImportConfig.xml 中添加了 3 个解决方案和一个数据文件

My Challenge is I want to import the solutions and Data files in sequence like:我的挑战是我想按顺序导入解决方案和数据文件,例如:

  1. Import Solution 1, Solution 2导入方案一、方案二
  2. Import Data File导入数据文件
  3. Import Solution 3导入解决方案 3

How to configure such a sequence?如何配置这样的序列?

Due to a lack of Documentation and resources could not proceed with achieving this challenge.由于缺乏文档和资源,无法继续应对这一挑战。

Please help!请帮忙!

Below is my ImportConfig.xml下面是我的 ImportConfig.xml

<?xml version="1.0" encoding="utf-16"?>

<!--
  More information about ImportConfig.xml file
  https://docs.microsoft.com/en-us/power-platform/alm/package-deployer-tool
-->
<configdatastorage xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                   installsampledata="false"
                   waitforsampledatatoinstall="true"
                   agentdesktopzipfile=""
                   agentdesktopexename=""
                   crmmigdataimportfile="BookingStatusData.zip">
    <!-- solutions to import -->
    <solutions>
        <configsolutionfile solutionpackagefilename="Solution1.zip" />
        <configsolutionfile solutionpackagefilename="Solution2.zip" />
        <configsolutionfile solutionpackagefilename="Solution3.zip" />
    </solutions>
    <filesmapstoimport>
        <configimportmapfile filename="BookingStatusSchema.xml" />
    </filesmapstoimport>
    <filestoimport>
        <configimportfile filename="BookingStatusData.zip"
        filetype="ZIP"
        associatedmap="BookingStatusSchema"
        importtoentity="bookingstatus"
        datadelimiter=""
        fielddelimiter="comma"
        enableduplicatedetection="true"
        isfirstrowheader="true"
        isrecordownerateam="false"
        owneruser=""
        waitforimporttocomplete="false" />
    </filestoimport>
</configdatastorage>

The standard package deployment is designed as a somewhat straightforward process and unfortunately data import can only occur after all solutions have been processed.标准 package 部署被设计为一个有点简单的过程,不幸的是,数据导入只能在所有解决方案都已处理后进行。

However, when you need extra flexibility you could consider adding a custom ImportExtension class to your project.但是,当您需要额外的灵活性时,您可以考虑将自定义ImportExtension class 添加到您的项目中。 In this class you can skip the import of Solution3.zip as part of the regular process and import it separately after the primary import has been completed.在此 class 中,您可以跳过作为常规过程的一部分的 Solution3.zip 的导入,并在初级导入完成后单独导入。

[Export(typeof(IImportExtensions))]
public sealed class DeploymentExtension : ImportExtension
{
    /// <summary>
    /// Called when a single solution is queued for import. Implementation can decide what is to be done.
    /// </summary>
    public override UserRequestedImportAction OverrideSolutionImportDecision(string solutionUniqueName, Version organizationVersion, Version packageSolutionVersion, Version inboundSolutionVersion, Version deployedSolutionVersion, ImportAction systemSelectedImportAction)
    {
        return solutionUniqueName == "<Solution3UniqueName>"
            ? UserRequestedImportAction.Skip
            : UserRequestedImportAction.Default;
    }

    /// <summary>
    /// Called after all solution and data imports have been completed. 
    /// </summary>
    /// <returns></returns>
    public override bool AfterPrimaryImport()
    {
        string solutionFilePath = Path.Combine(CurrentPackageLocation, "PkgFolder", "Solution3.zip");
        CrmSvc.ImportSolutionToCrm(solutionFilePath, out Guid _);
        return true;
    }
}

Alternatively you could just import Solution3.zip entirely separated from the other components using Azure DevOps task microsoft-IsvExpTools.PowerPlatform-BuildTools.import-solution.PowerPlatformImportSolution@2 .或者,您可以使用 Azure DevOps 任务microsoft-IsvExpTools.PowerPlatform-BuildTools.import-solution.PowerPlatformImportSolution@2导入 Solution3.zip 与其他组件完全分开。

Is there a reason its important to import data between solutions?在解决方案之间导入数据是否重要? the process that PD uses is as follows: PD使用的过程如下:

  1. Validate Depoloyment based on configuration根据配置验证部署
  2. Run package Init code运行 package 初始化代码
  3. Run solutions in deployment order (as specified in the ImportConfig.Xml file)按部署顺序运行解决方案(在 ImportConfig.Xml 文件中指定)
  4. Run Pre/Post/Upgrade code around each solution围绕每个解决方案运行预/后/升级代码
  5. Run Post Solutions code运行后期解决方案代码
  6. Check to see if Data import is allowed检查是否允许数据导入
  7. Run flat file imports (xml / csv's / maps / etc..)运行平面文件导入(xml/csv/maps/等等)
  8. Run CMT import data (which has its own schema / config checks and so on)运行 CMT 导入数据(它有自己的架构/配置检查等)
  9. Run Post Deployment Code运行部署后代码

The reason Data is after solutions is data is always dependent on schema, which is deployed by solutions.数据在解决方案之后的原因是数据总是依赖于解决方案部署的模式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure DevOps - PowerApps 包部署器 - 不能对空值表达式调用方法 - Azure DevOps - PowerApps package Deployer - You cannot call a method on a null-valued expression 容器化解决方案的发布管道 - Release Pipelines for Containerized Solutions 从常规 .zip 文件创建 webdeploy 包 - Create webdeploy package from regular .zip file “未找到包 init 文件(或不是常规文件)”- 为命名空间包构建 sdist 时出错 - "Package init file not found (or not a regular file)" - error when building sdist for namespace package 使用 WebPublishMethod 打包的 MSBuild 在 zip 文件中生成错误的文件名 - MSBuild with WebPublishMethod to package produces wrong file names in zip file 如何在VSTS中构建相互依赖的解决方案 - How to build interdependent solutions in VSTS 两种解决方案中的 Git 项目跟踪 - Git project tracking in both solutions 将Azure DevOps管道变量传递到package.json文件 - Pass Azure DevOps pipeline Variable to package.json file 将配置文件从 nuget package 复制到应用程序文件夹 - Copy config file from nuget package to application folder NuGet软件包中包含的解决方案文件与持续构建不兼容 - Solution file included in NuGet package incompatible with continuous build
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM