Azure Выпуск DevOps не может найти пакет - PullRequest
0 голосов
/ 04 августа 2020

У меня возникли проблемы с настройкой Azure выпусков DevOps на pu sh и ASP. NET службы на локальном сервере.

Мой конвейерный yaml выглядит так:

trigger:
- master

pool:
  vmImage: 'windows-latest'

variables:
  solution: '**/*.sln'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Dev'

steps:
- task: NuGetToolInstaller@1

- task: NuGetCommand@2
  inputs:
    restoreSolution: '$(solution)'

- task: PowerShell@2
  inputs:
    targetType: inline
    script: echo 'building $(solution) to $(Build.ArtifactStagingDirectory)'

- 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: PowerShell@2
  inputs:
    targetType: inline
    script: echo 'publishing CameraService from $(Build.ArtifactStagingDirectory)'
  

- task: PublishBuildArtifacts@1
  inputs:
    pathtoPublish: '$(Build.ArtifactStagingDirectory)' 
    artifactName: 'CameraService'

Конвейер успешно строится, но я не совсем понимаю, куда помещается пакет / артефакт. В нескольких руководствах, похоже, указывается, что есть ссылка на задание, но я не вижу ее в пользовательском интерфейсе devOps.

В моем выпуске задача развертывания веб-приложений IIS завершается с ошибкой:

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

Я не вижу места, где можно просмотреть артефакты, чтобы убедиться, что они соответствуют пути, указанному в выпуске. Любая помощь будет принята с благодарностью!

* Изменить: добавление yaml из двух задач по запросу:

Управление веб-приложением IIS

steps:
- task: IISWebAppManagementOnMachineGroup@0
  displayName: 'IIS Web App Manage'
  inputs:
    IISDeploymentType: '$(Parameters.IISDeploymentType)'
    WebsiteName: '$(Parameters.WebsiteName)'
    AddBinding: '$(Parameters.AddBinding)'
    Bindings: '$(Parameters.Bindings)'
    ParentWebsiteNameForVD: '$(Parameters.WebsiteName)'
    VirtualPathForVD: '$(Parameters.VirtualPathForApplication)'
    ParentWebsiteNameForApplication: '$(Parameters.WebsiteName)'
    VirtualPathForApplication: '$(Parameters.VirtualPathForApplication)'
    PhysicalPathForApplication: '%SystemDrive%\inetpub\wwwroot\[*removed for security even tho it's proably ok*]'
    AppPoolName: '$(Parameters.AppPoolName)'

Веб-приложение IIS Развернуть

steps:
- task: IISWebAppDeploymentOnMachineGroup@0
  displayName: 'IIS Web App Deploy'
  inputs:
    WebSiteName: '$(Parameters.WebsiteName)'
    TakeAppOfflineFlag: True
    XmlVariableSubstitution: True

1 Ответ

1 голос
/ 05 августа 2020

Я не вижу места, где можно было бы просмотреть артефакты, чтобы убедиться, что они соответствуют пути, указанному в версии.

Вы можете выполнить мои шаги, чтобы определить причину проблемы и разрешите его.

Для стороны конвейера сборки:

1.Проверьте журнал задачи PublishBuildArtifact и убедитесь, что он загружает файлы.

enter image description here

2.Navigate to pipeline run page and download the uploaded package to check:

enter image description here

For Classic Release pipeline(GUI) side:

1.Normally we set the build pipeline run as artifact source:

enter image description here

enter image description here

After setting the build pipeline run as artifact source, the release will automatically download the outputs from build pipeline.

2.For IIS Web App Deploy task, you can use this button to view its content.

enter image description here

Check if the Build Artifact from Build pipeline do produces a xx.zip file.

введите описание изображения здесь

Примечание:

Нам нужно добавить конвейер сборки в качестве источника артефактов конвейера выпуска (рекомендуется) или добавить download artifact task в задание агента, чтобы что наш выпуск может получить доступ к артефактам сборки.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...