VSTS
并将其部署到
AWS Beanstalk
vsts-ci.yml
文件如下:
# ASP.NET
# Build and test ASP.NET web applications.
# Add steps that publish symbols, save build artifacts, deploy, and more:
# https://docs.microsoft.com/vsts/pipelines/apps/aspnet/build-aspnet-4
pool:
vmImage: 'VS2017-Win2016'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller@0
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: VSBuild@1
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(Build.artifactStagingDirectory)"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSTest@2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
这是我的第一步
build
运行正常。顺便说一句,代理池是
Hosted VS2017
.
然后我创建了一个发布管道,如下所示:
作为第一阶段的任务(在工件步骤之后运行的部分),我有以下几点:
我已经将构建连接到一个主分支提交,并将发布连接到一个成功的构建,这些触发器工作正常。尽管失败了。这个问题是由找不到工件文件引起的,可能是因为错误的路径输入。但我不知道正确的版本。
.zip
包含已发布版本的文件:
但在这之后,发布失败了,只是说没有这样的文件。我曾经尝试过很多种方法
Web Deploy Archive
你看到的powershell任务,我创建它是为了检查路径,以及路径中包含的内容,它们大部分都是空的。
我发现一件有趣的事情是,build将文件放入
D:\a\1\a
D:\a\r1\a
当我给
Web部署存档
具有的字段
$(System.defaultWorkingDirectory)
和
$(Build.artifactStagingDirectory)
另一件奇怪的事是
Download artifact
Linked artifact count: 0
. 我希望这是另一回事。
更新:
我添加了“Publish Artifact:drop”
什么时候?
Path to publish
发布生成项目失败,错误为:找不到路径发布:D:\a\r1\a\project-2-代码.zip
什么时候?
要发布的路径
是“$(System.DefaultWorking目录)"
发布生成项目失败,错误为:找不到路径发布:D:\a\r1\a\$(Build.ArtifactStagingDirectory文件)