简体   繁体   English

如何配置 Azure CI/CD 以更新最新更改

[英]How to configure Azure CI/CD to update latest changes

I am currently developing a chatbot using the azure bot service framework and am having difficulty understanding how to get the latest changes published to the web chat once the pipeline has completed.我目前正在使用 azure 机器人服务框架开发一个聊天机器人,并且很难理解如何在管道完成后获取发布到 web 聊天的最新更改。

I configured the pipeline through azure and pointed it at my repo and master branch, but for some reason when the pipeline has completed the web chat doesn't get updated even though the pipeline includes a publish step.我通过 azure 配置了管道并将其指向我的 repo 和 master 分支,但由于某种原因,当管道完成 web 聊天时,即使管道包含发布步骤,聊天也没有得到更新。

Is there a setting I am missing in order to get the web chat to update automatically?为了让 web 聊天自动更新,我是否缺少设置?

Thanks谢谢

You can follow the steps below to configure CI/CD.您可以按照以下步骤配置 CI/CD。

In Pipeline CI , you could set the master branch as trigger.Pipeline CI中,您可以将master分支设置为触发器。 In this case, when the master branch changes, Build will be triggered.在这种情况下,当 master 分支发生变化时,会触发 Build。

You could add build step and publish artifacts steps in CI.您可以在 CI 中添加构建步骤和发布工件步骤。 Then the build will create an artifact which could be used in the CD(Release) step.然后构建将创建一个可以在 CD(发布)步骤中使用的工件。

For example:例如:

trigger:
- master

pool:
  vmImage: 'windows-latest'

steps:

- task: NuGetCommand@2
  displayName: 'NuGet restore'
  inputs:
    restoreSolution: 'application/*.sln'

- task: VSBuild@1
  displayName: 'Build solution application/*.sln'
  inputs:
    solution: 'application/*.sln'
    msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(Build.ArtifactStagingDirectory)/package/$(Build.BuildId).zip"'

- task: PublishPipelineArtifact@0
  inputs:
    artifactName: 'applicationpackage'
    targetPath: '$(Build.ArtifactStagingDirectory)/package'

In Release CD , you could set the CD trigger for the release and select the Build as the artifacts resource.Release CD中,您可以将发布的 CD 触发器和 select Build设置为工件资源。 If you need to use the ARM template, you also could add the resource repo as another artifacts.如果您需要使用 ARM 模板,您还可以将资源 repo 添加为另一个工件。

在此处输入图像描述

When you set the CD trigger, the release will run after the build pipeline finishes.设置 CD 触发器时,版本将在构建管道完成后运行。

You could add the release tasks in the Release Pipeline .(eg Azure resource group deployment , Azure App Service deploy )您可以在发布管道中添加发布任务。(例如Azure resource group deploymentAzure App Service deploy

Here is a official doc about Azure DevOps CI/CD pipelines for chatbots .这是关于Azure DevOps CI/CD pipelines for chatbots的官方文档。 You could refer to it.你可以参考一下。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM