git - Azure管道: Download zipped solution from git repo + upload

标签 git azure azure-devops

我正在将 Azure 管道与 Git 存储库一起用于 .net 应用程序。

是否有一个构建步骤可以实现

  1. 从 git 存储库下载压缩的解决方案(源文件)
  2. 并将 zip 文件上传到外部 API

最佳答案

我可以帮忙下载。还没有尝试过上传,但也许您可以重复使用相同的想法。一个想法是有一个脚本可以调用“curl”命令来下载 zip 文件,如下例所示,我在其中创建一些文件夹结构,然后删除下载的文件

- task: CmdLine@2
  inputs:
    script: |
      cd Folder1
      cd Folder2
      mkdir models

      curl --output models/model_name.bin https://s3.amazonaws.com/models.test/model_name.bin

并替换 URL 和目标文件夹并尝试一下:)

更新:

我只是发现但没有测试它。下面是用于上传的curl命令:

要将文件上传到 FTP 服务器,命令为:

curl -T FILENAME SERVER_ADDRESS -user USERNAME:PASSWORD

关于git - Azure管道: Download zipped solution from git repo + upload,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59970758/

相关文章:

java - 来自非 Activity 更改列表的文件已修改

azure - 在 Docker Swarm 中挂载 Azure 存储

sql - 将包含加密列的 Azure SQL Server 数据库从一个订阅复制到另一个订阅的最佳方法

json - Azure 管道 : Read values from json file in the repo and store it in pipeline variable (without powershell)

git - 当我们使用子树 merge 策略时,git如何找到子树?

git - 为什么我的 GitHub pull 请求显示不是我提交的提交?

git - 使用 git ls-files 从根目录而不是当前工作目录列出文件

azure - 还有其他方法可以改善 Azure CDN 延迟吗?

azure-devops - 使用 Azure Devops 自托管构建代理避免 git clean

azure - pkgs.visualstudio.com 和 pkgs.dev.azure.com 之间有什么区别?