[英]Can we have two Build.ArtifactStagingDirectory location for one repo in one azure-pipeline yaml file to publish two different debian installer
I want to create two debian installers ( packageName1
& packageName2
) in same repo of azure-pipeline with same feed
.我想在具有相同feed
的 azure-pipeline 的相同 repo 中创建两个 debian 安装程序( packageName1
和packageName2
)。 Below is the task of my azure-pipeline.yaml file下面是我的 azure-pipeline.yaml 文件的任务
- task: PublishBuildArtifacts@1
displayName: 'Publish artifacts'
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'Installer package and anti-virus scan results'
- task: UniversalPackages@0
displayName: Publish univeral package-1
inputs:
command: publish
publishDirectory: '$(Build.ArtifactStagingDirectory)'
vstsFeedPublish: '$(packageFeed)'
vstsFeedPackagePublish: '$(packageName1)'
packagePublishDescription: ''
versionOption: custom
versionPublish: $(packageVersion1)
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
- task: UniversalPackages@0
displayName: Publish univeral package-2
inputs:
command: publish
publishDirectory: '$(Build.ArtifactStagingDirectory)'
vstsFeedPublish: '$(packageFeed)'
vstsFeedPackagePublish: '$(packageName2)'
packagePublishDescription: ''
versionOption: custom
versionPublish: $(packageVersion2)
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
But when I am downloading artifact for one of the package installer through az command:但是当我通过 az 命令为 package 安装程序之一下载工件时:
az artifacts universal download \
--organization "https://myplatform.visualstudio.com/" \
--feed "my-feed" \
--name $packageName1 \
--version $packageVersion1 \
--path .
the packages and files of packageName2
are also getting downloaded. packageName2
的包和文件也正在下载。 I feel that's because I am using same Build.ArtifactStagingDirectory
location to store/publish the artifacts for both packages.我觉得那是因为我使用相同的Build.ArtifactStagingDirectory
位置来存储/发布两个包的工件。 Can I use different location for both installer packages?我可以为两个安装程序包使用不同的位置吗?
You can create a subfolder under Build.ArtifactStagingDirectory
for each project and publish each artifact separately.您可以在Build.ArtifactStagingDirectory
下为每个项目创建一个子文件夹并单独发布每个工件。
There aren't 'multiple artifact directories', but you can create as many folders under the directory as you want and then pass the subfolder into the build and publish tasks.没有“多个工件目录”,但您可以根据需要在目录下创建任意多个文件夹,然后将子文件夹传递到构建和发布任务中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.