我有构建和发布定义。我正在发布一些 ps1 文件以发布定义以在发布定义时运行。所以在脚本中我使用这个路径:d:\a\r1\a但我不想使用此路径而不是 wan 使用相对路径调用。如何使用环境变量调用它?
似乎我无法再通过 API https://docs.microsoft.com/en-us/rest/api/vsts/release/definitions/update?view=vsts-rest-5.0更新 VSRM 版本定义
唯一我改变的事情是从版本号11来12获取释放定义之后。
API 网址:https://.vsrm.visualstudio.com/One/_apis/Release/definitions?api-version=5.0-preview.3
响应:{ "$id": "1", "innerException": null, "message": "您正在使用版本定义的旧副本。刷新您的副本并重试。", "typeName": "Microsoft.VisualStudio .Services.ReleaseManagement.Data.Exceptions.InvalidRequestException, Microsoft.VisualStudio.Services.ReleaseManagement2.Data", "typeKey": "InvalidRequestException", "errorCode": 0, "eventId": 3000 }
我尝试了api 版本4.1和5.0预览 api 版本。同样的错误。我将 PostMan 与 PAT 一起使用。GET 工作正常。
你能告诉我我做错了什么吗?
azure-devops azure-pipelines-release-pipeline azure-devops-rest-api
目前,正在尝试在 Azure Devops 中配置发布管道。我已经成功创建了一个正在运行并成功运行测试的 CI 管道。我的发布管道使用来自最新 CI 构建的工件,应该部署到 azure。当我查看日志时,我可以看到以下内容已成功完成:
然后“部署到 Azure 应用服务”失败,日志显示以下详细信息:
2019-02-07T19:06:57.5433805Z Got service connection details for Azure App Service:'MyApp'
2019-02-07T19:06:57.5487495Z ##[error]Error: Failed to get resource ID for resource type 'Microsoft.Web/Sites' and resource name 'MyAPP'. Error: Could not fetch access token for Managed Service Principal. Please configure Managed Service Identity (MSI) for virtual machine 'https://aka.ms/azure-msi-docs'. Status code: 400, status message: Bad Request
2019-02-07T19:06:57.5496340Z Failed to add release annotation. TypeError: Cannot read property 'getApplicationSettings' of undefined
Run Code Online (Sandbox Code Playgroud)
到目前为止,我还没有找到太多帮助。我通过 …
deployment azure azure-devops azure-pipelines-release-pipeline azure-devops-hosted-agent
如果阶段中出现任何问题,我想发送通知。如何在发布管道的任务中设置条件,以便在以前失败时运行该任务?
但考虑一种情况,有一个任务失败,然后有一个任务将始终运行,之后的任务是如果出现任何问题我想要运行的任务。
我有一个由 CI 触发的发布管道,如果该版本尚不存在,我想推送新版本的 nuget 包。
为此,我有一个简单的命令行任务,它检查 nuget.org 上是否存在该 nuget 并将结果存储在环境变量中。
然后,我可以设置后续步骤的条件,只有当该值变量为 true 时才会执行该步骤。
这一切都很好,但是我想知道如何简单地停止发布过程并跳过所有后续步骤,而不需要一一设置它们的条件。
另外,如何将任务的构建状态设置为“已取消”?
azure-devops azure-pipelines-build-task azure-pipelines azure-pipelines-release-pipeline
我是 Aure Dev Ops 的新 CI/CD 领域。所以我创建了一个测试 ASP.NET MVC 应用程序。我在 Visual Studio Online 的 git repo 中签入了该应用程序。我的构建管道工作正常,但ms build似乎找不到我发布的文件所在位置的配置。这是我msbuild configuration的yml文件:
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"'
Run Code Online (Sandbox Code Playgroud)
在我的发布管道中,我使用了copy task以下内容yml
steps:
- task: CopyFiles@2
displayName: 'Copy Files to: $(Build.ArtifactStagingDirectory)/deploy'
inputs:
SourceFolder: '$(build.artifactStagingDirectory)'
TargetFolder: '$(Build.ArtifactStagingDirectory)/deploy'
Run Code Online (Sandbox Code Playgroud)
这是我尝试部署发布时遇到的错误:
##[error]Unhandled: Not found SourceFolder: D:\a\r1\a\$(build.artifactStagingDirectory)
Run Code Online (Sandbox Code Playgroud) yaml build-pipeline azure-devops azure-pipelines-release-pipeline
我有一个托管在 Azure 中的 Web 应用程序,文件wwwroot夹中包含一些文件。我在 之外还有其他人wwwroot,实际上在components同级调用的目录中。
到目前为止,我一直在使用 Kudu 控制台手动更新文件,将 ZIP 文件放入components. 我已经开始将我的流程转移到 Azure Pipelines;我设法配置了一个构建管道,该管道自动生成并压缩文件/工件以放入components.
现在我正在尝试配置发布管道以将文件从构建部署到components. 问题是我无法在默认情况下或从 Marketplace 中找到允许我将目标路径配置为的任务components;wwwroot默认情况下,它们都针对部署。
是否有任何类型的任务或脚本来实现这一目标?
这是我第一次面对使用 Azure Pipelines 设置 CI/CD,也许我忽略了一些东西。
kudu azure-devops azure-pipelines azure-pipelines-release-pipeline azure-webapps
在 Azure DevOps Services 的发布工作流中,在设置持续部署触发器时,有这个选项
'构建管道的默认分支'
. 我不明白这意味着什么,以及如何查看项目中不同管道的默认分支。对这方面文档的任何参考也将有所帮助
这也出现在管道中的其他几个地方,但我现在不记得了。
谢谢,
azure-devops azure-pipelines azure-pipelines-release-pipeline
我正在使用 azure-pipelines.yaml 来构建多个阶段,每个阶段都有相同的变量,即 var_key 但每个阶段的值不同,为此我有不同的 Azure 库组
azure-pipelines.yaml
name: $(Date:yyyyMMdd)$(Rev:.r)
pr:
branches:
include:
- develop
- master
trigger:
branches:
include:
- develop
- master
variables:
group: group1, group2, group3
BuildNumber: $(Build.BuildNumber)
stages:
- stage: debug
jobs:
- job: DebugConditions
pool:
vmImage: 'ubuntu-latest'
steps:
- bash: echo $(group1.var_key)
- stage: dev
jobs:
- job: DevConditions
pool:
vmImage: 'ubuntu-latest'
steps:
- bash: echo $(group2.var_key)
Run Code Online (Sandbox Code Playgroud)
这给了我一个错误,是否有正确的方法来做到这一点。
yaml azure azure-devops azure-pipelines azure-pipelines-release-pipeline
我有一个 docker compose .yml 文件,用于在 Linux Azure 应用服务上手动安装和运行多个 docker 映像。我的下一步是通过 Azure Pipelines 自动执行此操作,我已成功为单个映像执行此操作;但无法弄清楚如何为同一应用服务实例上的多个图像执行此操作。
这是在同一应用服务实例上运行多个图像的客户端要求。如果有更好的方法,我有一些灵活性,但成本是一个因素。
我特别在寻找要添加到我的发布管道中的任务类型,以及是否有任何我可以阅读的示例或文档。到目前为止,我还没有发现任何似乎真正符合要求的东西,但我不是 DevOps 工程师,所以很可能我只是没有正确地问这个问题。
这是我拥有的 docker compose yml 文件的示例。
version: '3.7'
services:
exampleapi:
image: examplecontainerregistry.azurecr.io/example.api:latest
container_name: example.api
volumes:
- example:/mnt/example
- common:/mnt/common
certprojectservice:
image: examplecontainerregistry.azurecr.io/example.certproject.service:latest
container_name: example.certproject.service
volumes:
- example:/mnt/example
- common:/mnt/common
unityemailservice:
image: examplecontainerregistry.azurecr.io/example.email.service:latest
container_name: example.email.service
volumes:
- example:/mnt/example
- common:/mnt/common
eventconsumerservice:
image: examplecontainerregistry.azurecr.io/example.eventconsumers.service:latest
container_name: example.eventconsumers.service
volumes:
- example:/mnt/example
- common:/mnt/common
webhookresponseservice:
image: examplecontainerregistry.azurecr.io/example.webhookresponse.service:latest
container_name: example.webhookresponse.service
volumes:
- example:/mnt/example
- common:/mnt/common
unitywebhooksservice:
image: examplecontainerregistry.azurecr.io/example.webhooks.service:latest
container_name: example.webhooks.service …Run Code Online (Sandbox Code Playgroud) docker-compose azure-web-app-service docker-container azure-pipelines-release-pipeline