gpt4 book ai didi

Azure Pipeline 从 Azure 存储库 check out 代码并构建工件

转载 作者:行者123 更新时间:2023-12-03 06:48:03 24 4
gpt4 key购买 nike

我正在使用 azure pipeline 从 azure repo checkout 源代码,并执行由 webmethod SAG 提供的内置脚本的设置,使用 build.yaml 我可以构建我的应用程序,但无法发布工件。

cat build.yaml

trigger:
- devops-build

pool:
name: CICD

steps:
# Create Target Directory to keep git repo for later use
- bash: |
mkdir -p /home/user/cicd_source/dev/packages/packages
displayName: 'create directory'

- bash: |
echo "webname=${{parameters.projectName}}" > $(Build.ArtifactStagingDirectory)/devpackagename.properties
echo "BuildNumber=$(Build.BuildNumber)" > $(Build.ArtifactStagingDirectory)/devBuildNumber.txt

Above script will create devpackagename.properties and devBuildNumber.txt following path inside my self hosted agent directory work location.

密码/home/用户/代理/CICD/_work/1/aLS-轻轨devpackagename.propertiesdevBuildNumber.txt


cat devpackagename.properties
webname=package
cat devBuildNumber.txt
BuildNumber=20221004.83

成功运行管道后,我没有看到管道内发布任何工件

Build image

最佳答案

在构建步骤之后添加以下任务

 - task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifact: 'drop'
publishLocation: 'pipeline'

您会看到工件在管道上发布

关于Azure Pipeline 从 Azure 存储库 check out 代码并构建工件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73950790/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com