如何手动将文件发布到Azure Artifacts? [英] How to manually publish a file to Azure Artifacts?

查看:60
本文介绍了如何手动将文件发布到Azure Artifacts?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在本地计算机上手动创建的文件.我在几个Azure DevOps管道中都需要它.

我想将其用作工件".

我知道如何从Azure DevOps管道内发布工件,但是我只想从计算机上载此特定文件.我该怎么办?

解决方案

如何手动将文件发布到Azure Artifacts?

众所周知,Artifact的本质是共享文件的存储.我们可以从发布构建工件任务中大致获得以下信息:

但是工件发布位置的默认值为 Azure管道:

这是在Azure上设置的共享场所.

更新:

谢谢分享:

我们可以使用AZ命令行从本地上传到共享地点,例如:

az工件通用发布--organization https://dev.azure.com/example/--feed my_feed --name my-artifact-name --version 0.0.1 --description测试说明";--path

现在,让我们回到以"Artifact的本质是共享文件的存储"开始的第一句话,因此我们可以创建一个共享位置/文件夹来保存文件.现在将其视为工件".然后,我们只需要确保其他管道可以访问此共享的位置/文件夹即可.

例如,我们可以在私有代理所在的服务器上创建一个文件夹,然后只需要将您的文件复制到该文件夹​​即可.现在,我们可以在使用私有代理构建管道时使用它.显然,这不仅限于本地文件夹,我们还可以创建一个网络文件夹,只需要确保其他管道可以访问它即可.

希望这会有所帮助.

I have a file which I have created manually on my local computer. I need it in several Azure DevOps pipelines.

I want to use it as an "Artifact".

I know how to publish artifacts from within an Azure DevOps Pipeline, but this specific file I just want to upload from my computer. How can I do it?

解决方案

How to manually publish a file to Azure Artifacts?

As we know, the essence of Artifact is the storage of a shared file. We can roughly get this information from the Publish build artifacts task:

But the default value of Artifact publish location is Azure Pipelines:

This is a shared place set up on Azure.

Update:

Thanks hey sharing:

We could upload from local to the shared place with AZ command line, like:

az artifacts universal publish --organization https://dev.azure.com/example/ --feed my_feed --name my-artifact-name --version 0.0.1 --description "Test Description" --path

Now let us return to the first sentence we started with "the essence of Artifact is the storage of a shared file", so we could create a shared place/folder to save the file. It is now seen as "Artifact". Then we just need make sure other pipelines could access this shared place/folder.

For example, we could create a folder on the server where our private agent is located, then we just need to copy your file to that folder. Now, we could use it when we build the pipeline with private agent. Obviously this is not limited to local folders, we can also create a network folder, only need to ensure that other pipelines can access it.

Hope this helps.

这篇关于如何手动将文件发布到Azure Artifacts?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆