Я получаю сообщение об ошибке при развертывании в IIS:
2020-04-06T10:51:49.9302914Z ##[error]Error: No package found with specified pattern.<br/>Check if the package mentioned in the task is published as an artifact in the build or a previous stage and downloaded in the current job.
У меня было:
$(System.DefaultWorkingDirectory)\**\*.zip
в качестве папки пакета в задаче развертывания IIS Web App, и после первого я получил ошибка Я изменил папку, выбрав расположение папки:
$(System.DefaultWorkingDirectory)/_MyProject-ASP.NET-CI
, но это ничего не помогло. Ошибка остается прежней.
Это мой YAML:
steps:
- task: IISWebAppDeploymentOnMachineGroup@0
displayName: 'IIS Web App Deploy'
inputs:
WebSiteName: '$(Parameters.WebsiteName)'
VirtualApplication: dev.myproject.com
Package: '$(System.DefaultWorkingDirectory)/_MyProject-ASP.NET-CI'
ExcludeFilesFromAppDataFlag: true
TakeAppOfflineFlag: True
XmlTransformation: true
XmlVariableSubstitution: True
и следующее для Publi sh Артефакт задача:
steps:
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
ArtifactName: '$(Parameters.ArtifactName)'
condition: succeededOrFailed()
У меня также есть задача Копировать файлы в моей сборке:
steps:
- task: CopyFiles@2
displayName: 'Copy Files to: $(Build.ArtifactStagingDirectory)'
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
перед задачей Publi sh Артефакт .
I искали похожую проблему, но нашли только такие решения: Azure Ошибка выпуска конвейера DevOps: не найден пакет с указанным шаблоном: D: \ a \ r1 \ a \ ** \ *. zip , которые не являются актуально, поскольку мой YAML выглядит так, как будто они советуют, и у меня есть задача «Копировать файлы», как уже упоминалось.
Полный журнал для этого этапа:
2020-04-06T10:51:48.3476113Z ##[section]Starting: IIS Web App Deploy
2020-04-06T10:51:48.3785215Z ==============================================================================
2020-04-06T10:51:48.3786130Z Task : IIS web app deploy
2020-04-06T10:51:48.3786911Z Description : Deploy a website or web application using Web Deploy
2020-04-06T10:51:48.3787618Z Version : 0.156.9
2020-04-06T10:51:48.3788205Z Author : Microsoft Corporation
2020-04-06T10:51:48.3789263Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/deploy/iis-web-app-deployment-on-machine-group
2020-04-06T10:51:48.3790410Z ==============================================================================
2020-04-06T10:51:49.9302914Z ##[error]Error: No package found with specified pattern.<br/>Check if the package mentioned in the task is published as an artifact in the build or a previous stage and downloaded in the current job.
2020-04-06T10:51:49.9420801Z ##[section]Finishing: IIS Web App Deploy
У меня заканчиваются идеи, что это может быть!
Я новичок в выпуске, поэтому совершенно не уверен, чего еще не хватает или правильно его настраиваю.
РЕДАКТИРОВАТЬ
Это полная сборка YAML:
pool:
name: Azure Pipelines
demands:
- msbuild
- visualstudio
steps:
- task: NuGetToolInstaller@0
displayName: 'Use NuGet 4.4.1'
inputs:
versionSpec: 4.4.1
- task: NuGetCommand@2
displayName: 'NuGet restore'
inputs:
restoreSolution: '$(Parameters.solution)'
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@3
displayName: 'Use Yarn 1.22.1'
inputs:
versionSpec: 1.22.1
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-task.Yarn@3
displayName: 'Yarn install'
inputs:
projectDirectory: Web
arguments: install
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-task.Yarn@3
displayName: 'Yarn build'
inputs:
projectDirectory: Web
arguments: build
- task: VSBuild@1
displayName: 'Build solution'
inputs:
solution: '$(Parameters.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
displayName: 'Test Assemblies'
inputs:
testAssemblyVer2: |
**\$(BuildConfiguration)\*test*.dll
!**\obj\**
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
enabled: false
- task: PublishSymbols@2
displayName: 'Publish symbols path'
inputs:
SearchPattern: '**\bin\**\*.pdb'
PublishSymbols: false
continueOnError: true
- task: CopyFiles@2
displayName: 'Copy Files to: $(Build.ArtifactStagingDirectory)'
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
ArtifactName: '$(Parameters.ArtifactName)'
condition: succeededOrFailed()
РЕДАКТИРОВАТЬ 2
Журнал задачи VSBuild:
2020-04-07T15:37:05.6665411Z ##[section]Starting: Build solution
2020-04-07T15:37:05.7033615Z ==============================================================================
2020-04-07T15:37:05.7034084Z Task : Visual Studio build
2020-04-07T15:37:05.7034450Z Description : Build with MSBuild and set the Visual Studio version property
2020-04-07T15:37:05.7034755Z Version : 1.166.0
2020-04-07T15:37:05.7034990Z Author : Microsoft Corporation
2020-04-07T15:37:05.7035347Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/visual-studio-build
2020-04-07T15:37:05.7036406Z ==============================================================================
2020-04-07T15:37:13.7071155Z ##[command]"D:\a\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.166.0\ps_modules\MSBuildHelpers\vswhere.exe" -version [16.0,17.0) -latest -format json
2020-04-07T15:37:13.7989257Z ##[command]"D:\a\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.166.0\ps_modules\MSBuildHelpers\vswhere.exe" -version [16.0,17.0) -products Microsoft.VisualStudio.Product.BuildTools -latest -format json
2020-04-07T15:37:13.8796977Z ##[command]"D:\a\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.166.0\ps_modules\MSBuildHelpers\vswhere.exe" -version [15.0,16.0) -latest -format json
2020-04-07T15:37:14.2358042Z ##[command]"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\msbuild.exe" "D:\a\1\s\myproject.com.sln" /nologo /nr:false /dl:CentralLogger,"D:\a\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.166.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=0ce4c4e1-c2fb-42a2-b03b-860f664e3238|SolutionDir=D:\a\1\s"*ForwardingLogger,"D:\a\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.166.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="D:\a\1\a\\" /p:platform="any cpu" /p:configuration="release" /p:VisualStudioVersion="15.0" /p:_MSDeployUserAgent="VSTS_ec7516ed-027d-4f0f-95e9-525fa5443e34_build_6_0"
2020-04-07T15:37:14.3407720Z Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
2020-04-07T15:37:14.3741342Z Build started 4/7/2020 3:37:14 PM.
2020-04-07T15:37:14.5565930Z ##[warning]D:\a\1\s\myproject.com.sln.metaproj(0,0): Warning MSB4126: The specified solution configuration "release|any cpu" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration.
2020-04-07T15:37:14.5685931Z Project "D:\a\1\s\myproject.com.sln" on node 1 (default targets).
2020-04-07T15:37:14.5693512Z D:\a\1\s\myproject.com.sln.metaproj : warning MSB4126: The specified solution configuration "release|any cpu" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. [D:\a\1\s\myproject.com.sln]
2020-04-07T15:37:14.5773938Z Done Building Project "D:\a\1\s\myproject.com.sln" (default targets).
2020-04-07T15:37:14.5806168Z
2020-04-07T15:37:14.5806758Z Build succeeded.
2020-04-07T15:37:14.5931062Z
2020-04-07T15:37:14.5943625Z "D:\a\1\s\myproject.com.sln" (default target) (1) ->
2020-04-07T15:37:14.5945416Z (ValidateSolutionConfiguration target) ->
2020-04-07T15:37:14.5948111Z D:\a\1\s\myproject.com.sln.metaproj : warning MSB4126: The specified solution configuration "release|any cpu" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. [D:\a\1\s\myproject.com.sln]
2020-04-07T15:37:14.5952737Z
2020-04-07T15:37:14.5952959Z 1 Warning(s)
2020-04-07T15:37:14.5953123Z 0 Error(s)
2020-04-07T15:37:14.5954912Z
2020-04-07T15:37:14.5955667Z Time Elapsed 00:00:00.20
2020-04-07T15:37:14.6534792Z ##[section]Finishing: Build solution