azure - 在 Azure DevOps Server 上创建构建 zip,例如 github

标签 azure github build

目前,我正在使用 Azure DevOps Server 来管理我的项目。 在此之前我使用的是 GitHub。

Github 有一个发布功能表单,我们可以在其中下载任何先前版本的源代码。正如这里 Release list preview

所以, 有谁知道如何在 azure DevOps 中创建项目的源代码 zip 哪个存储在服务器上以及何时需要?我可以像Github一样下载该版本源代码的zip。

任何类似的东西,我都可以将完整的源代码存储为该版本的 zip 文件。 这样以后每当我需要项目的源代码时我都可以随时获取。

最佳答案

您需要关联 Azure 管道才能release artifacts and artifact sources

  • A release is a collection of artifacts in your DevOps CI/CD processes.
  • An artifact is a deployable component of your application.

Azure Pipelines can deploy artifacts that are produced by a wide range of artifact sources, and stored in different types of artifact repositories.

这可以包括使用 Archive Files task ,以便生成与 GitHub 相同的“源代码 (zip)”。
示例( from here ,作者 Mauricio Díaz Orlich ),根据您的情况进行调整:

- task: ArchiveFiles@2
  displayName: 'Compress Files'
  inputs:
    rootFolderOrFile: '$(Build.BinariesDirectory)'
    includeRootFolder: false
    archiveType: '7z'
    sevenZipCompression: 'maximum'
    archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildNumber).zip'
    replaceExistingArchive: true

关于azure - 在 Azure DevOps Server 上创建构建 zip,例如 github,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68870763/

相关文章:

Azure Functions 代理 - 路由到存储帐户

Azure Web Apps - 如何在部署之前运行脚本

azure - 在 foreach 中使用 if 时 Powershell 获得相同的值

Github,在不需要github用户帐户的情况下在存储库上创建问题

optimization - 我可以采取哪些步骤来优化 TeamCity 中的构建时间?

Azure - 托管磁盘,如何创建快照

javascript - 实时预览与代码扩展

github - 提交出现的分支列表

ruby - 如何调用 rake 目标两次

android - 获取构建失败并出现异常 Android Studio 0.4.3 和 0.4.4