No package found with specified pattern: D:\a\r1\a\**\*.zip

后端 未结 9 1496
太阳男子
太阳男子 2021-01-04 07:25

I created a build definition in vsts with npm build and then I copy the build folder to the drop location.

The build pipeline is working fine

Then I created

9条回答
  •  甜味超标
    2021-01-04 07:43

    Per Azure official document for setting up Pipelines (YAML files) for Node.js, Javascript apps from this link https://docs.microsoft.com/en-us/azure/devops/pipelines/ecosystems/javascript?view=azure-devops&tabs=code

    1. Configure the YAML file as below:
    trigger:
    - master
    
    pool:
      vmImage: 'ubuntu-latest'
    
    steps:
    - task: NodeTool@0
      inputs:
        versionSpec: '10.x'
      displayName: 'Install Node.js'
    
    - script: |
        npm install
        npm run build
      displayName: 'npm install and build'
    
    - task: CopyFiles@2
      inputs:
        Contents: 'build/**' # Pull the build directory (React)
        TargetFolder: '$(Build.ArtifactStagingDirectory)'
    
    - task: PublishBuildArtifacts@1
      inputs: 
        pathtoPublish: $(Build.ArtifactStagingDirectory) # dist or build files
        ArtifactName: 'www' # output artifact named www
    
    1. On the latest version of Azure Devops, edit Release under Pipeline. Note that Build section has been taken off in the latest version (as of June 2020), so some older answers/docs was not working.

    2. Click on Deploy Azure App Services and on the right panel click on ...(Expand Folder) for Package or folder Option

    3. Under Linked Artifacts => MyProject (Build) => www, select dist folder.

    Save this and then create release, this should solve the error [error]Error: No package found with the specified pattern: D:\a\r1\a\**\*.zip

提交回复
热议问题