简体   繁体   English

Azure Devops - 部署前清理目标目录

[英]Azure Devops - Clean Destination Directory Before Deployment

I have a Azure Devops build step like so:我有一个 Azure Devops 构建步骤,如下所示:

- 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. PublishBuildArtifact不会做你认为它做的事情。 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 .它所做的一切就是获取您指定路径中的文件,将它们上传到 Azure DevOps,并将它们附加到构建中,以便可以在其他管道中下载和使用它们。

So basically the premise of your question is faulty, as there is nothing to clear.所以基本上你的问题的前提是错误的,因为没有什么需要澄清的。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Azure Devops 部署组上运行 pm2 - Run pm2 on Azure Devops Deployment Group Azure DevOps 管道,用于项目和部署特定变量 - Azure DevOps pipelines for project and deployment specific variables 可以在构建期间在 Azure DevOps 上的源目录中创建文件 - Possible to create file in sources directory on Azure DevOps during build Azure NodeJS Azure Devops 部署失败,但 Visual Studio 部署工作完美 - Azure NodeJS Azure Devops deployment failing but Visual Studio deploy works perfect Azure Web App Node部署,更改应用程序根目录? - Azure Web App Node deployment, change app root directory? Angular 使用 Azure 部署 Devops 未加载 — 显示“嘿节点开发人员!” 页 - Angular Deployment using Azure Devops doesn't load — shows “hey node developers!” page Azure DevOps,管道错误##[警告]在缓存或工作目录 JsNode 中找不到调试日志 - Azure DevOps, Pipeline error ##[warning]Couldn't find a debug log in the cache or working directory JsNode 节点 JS 部署到 Azure Web 应用服务错误 - “您无权查看此目录或页面。” - Node JS Deployment to Azure Web App Service ERROR - "You do not have permission to view this directory or page." Nodejs Azure 部署失败:ENOENT:没有这样的文件或目录,stat '/home/site/wwwroot/node_modules/.bin/semver' - Nodejs Azure Deployment Failure: ENOENT: no such file or directory, stat '/home/site/wwwroot/node_modules/.bin/semver' Visual Studio Team Services Azure部署(无法对指定目录执行操作(“删除文件”)) - Visual Studio Team Services Azure deployment (Unable to perform the operation (“Delete File”) for the specified directory)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM