简体   繁体   中英

Azure Devops - Clean Destination Directory Before Deployment

I have a Azure Devops build step like so:

- task: PublishBuildArtifacts@1
  displayName: 'Publish Artifact: drop'
  inputs:
    PathtoPublish: '$(Build.ArtifactStagingDirectory)\ArtifactsToBePublished'

The publish step just deploys the app on top of what is currently in the directory, but in the meantime the entire app structure may have changed. Is there any way to clear the destination directory before the publish step takes place?

PublishBuildArtifact doesn't do what you think it does. All it does it takes the files in the path you specify, uploads them to Azure DevOps, and attaches them to the build so that they can be downloaded and consumed in other pipelines .

So basically the premise of your question is faulty, as there is nothing to clear.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM