如何在Bitbucket管道中保存工件 [英] How to save artifacts in Bitbucket-Pipelines

查看:71
本文介绍了如何在Bitbucket管道中保存工件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是竹子的新手.我试图做的是收集在构建过程中创建的所有.dacpac文件.

I am new to bamboo. What I try to do is collecting all .dacpac files that are created during the build process.

image: microsoft/dotnet:latest
pipelines:
 default: 
 - step: 
 script: # Modify the commands below to build your repository. 
 - cd BackgroundCode 
 - dotnet restore 
 - dotnet run 
 artifacts: 
 - '../**/*.dacpac'

目录结构为

'agent/build/Projects/[项目名称]/[项目名称] .dacpac'.

'agent/build/Projects/[Projectname]/[Projectname].dacpac'.

管道的输出说

成功生成的zip存档 /opt/atlassian/pipelines/agent/build/Projects/[ProjectName]/[ProjectName] .dacpac

Successfully generated zip archive /opt/atlassian/pipelines/agent/build/Projects/[ProjectName]/[ProjectName].dacpac

这意味着在构建过程中确实生成了文件. 我做错什么了吗?如果没有,我将在哪里找到这些工件.

which means there are really files generated during the build process. Have I done something wrong? If no, where would I find those artifacts.

推荐答案

不幸的是,根据文档,在管道运行后,所有工件都被删除:

Unfortunately according to the documentation all artifacts are deleted after the pipeline run:

https://confluence.atlassian.com/bitbucket/using-artifacts-in-steps-935389074.html

管道完成后,无论成功还是失败, 工件被删除."

"Once a pipeline completes, whether it succeeds or fails, the artifacts are deleted."

不过,您可以将工件部署到Bitbucket下载部分或其他任何地方:

However you can deploy artifacts to the Bitbucket downloads section, or anywhere else:

https://confluence.atlassian. com/bitbucket/deploy-build-artifacts-to-bitbucket-downloads-872124574.html

- step:
    name: Archive
    script:
      - curl -X POST --user "${BB_AUTH_STRING}" "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"something/**"

这篇关于如何在Bitbucket管道中保存工件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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