简体   繁体   English

Azure DevOps 步骤将 YAML 从 Azure 存储帐户复制到 DevOps 存储库

[英]Azure Devops step copy YAML from Azure storage account to DevOps repo

I wonder if anyone could advise, I am trying to find a way to release updated YAML files centrally to multiple DevOps projects via azure storage.我想知道是否有人可以建议,我正在尝试找到一种方法,通过 azure 存储将更新的 YAML 文件集中发布到多个 DevOps 项目。 So that a daily release can be updated to use newer version of a yasl pipeline.这样可以更新每日发布以使用更新版本的 yasl 管道。

Currently we use Azure lighthouse to release packages to storage and the individual pipelines pick them up and process however the YAML pipelines cannot be changed if additional steps are required.目前,我们使用 Azure 灯塔将包发布到存储,各个管道将它们拾取并处理,但是如果需要额外的步骤,则无法更改 YAML 管道。

Therefore I want to be able to pick up new versions of YAML in the same way the modules are picked up and update the local Devops repository.因此,我希望能够以与获取模块相同的方式获取 YAML 的新版本并更新本地 Devops 存储库。

How could this be achieved?这怎么可能实现?

Kind Regards M亲切的问候

As a workaround, we could download the YAML file from Azure storage account via AzCopy command and push the file via git cmd.作为一种解决方法,我们可以通过AzCopy command从 Azure 存储帐户下载 YAML 文件,然后通过 git ZDFFAFF04ZA7FA1A55C8CDAC45 推送文件

  1. Install AzCopy from: https://aka.ms/downloadazcopy-v10-windows从以下位置安装 AzCopy: https://aka.ms/downloadazcopy-v10-windows

  2. Read docs from: https://docs.microsoft.com/en-us/azure/storage/storage-use-azcopy阅读以下文档: https://docs.microsoft.com/en-us/azure/storage/storage-use-azcopy

  3. cd "C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy" cd "C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy"

  4. Get Blob Storage (Secondary) Key获取 Blob 存储(辅助)密钥

  5. Download single file via the cmd .\AzCopy /Source:https://myaccount.file.core.windows.net/myfileshare/myfolder/ /Dest:C:\myfolder /SourceKey:key /Pattern:xxx.yml Download single file via the cmd .\AzCopy /Source:https://myaccount.file.core.windows.net/myfileshare/myfolder/ /Dest:C:\myfolder /SourceKey:key /Pattern:xxx.yml

  6. Clone the azure devops repo via the git cmd:通过 git cmd 克隆 azure devops repo:

    git config --global user.email "xxx@xyz.com"

    git config --global user.name "Admin"

    git clone <repo> <directory>

  7. Copy the xxx.yml file to the folder.将 xxx.yml 文件复制到该文件夹。

  8. Then add a command line task to submit and push the changes to the repo:然后添加一个命令行任务来提交并将更改推送到 repo:

    git commit -m "Add docs.zip file"

    git push -u origin master

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

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