0
votes

I have two tasks at end of my build pipeline

    - task: ArchiveFiles@2
      inputs:
        rootFolderOrFile: '$(Build.BinariesDirectory)'
        includeRootFolder: false
        archiveType: '7z'
        sevenZipCompression: 'ultra'
        archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).7z'
        replaceExistingArchive: true

    - task: PublishPipelineArtifact@1
      inputs:
        targetPath: '$(Build.StagingDirectory)'
        publishLocation: 'filepath'
        fileSharePath: 'D:\Builds\some-folder'

What I need do or change here to make agents deleting artifacts when I delete specific build run? Or just remove published files with retention policy?

I am using Azure DevOps with 5 self-hosted agents on this same machine.

Update: To be clear retention policy is set but artifacts not being deleted from self-hosting machine.

1

1 Answers

0
votes

In the azure devops pipeline Retention policy, we can set the Days to keep artifacts, symbols and attachments. Normally, we set the days to thirty. Also, you can change it to other days. enter image description here Refer this doc: Set run retention policies