我是竹子新手 . 我尝试做的是收集在构建过程中创建的所有 .dacpac
文件 .
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 / [Projectname] / [Projectname] .dacpac' .
管道的输出说
成功生成zip存档/opt/atlassian/pipelines/agent/build/Projects/[ProjectName]/[ProjectName].dacpac
这意味着在构建过程中确实生成了文件 . 我做错了什么吗?如果不是,我会在哪里找到这些文物 .
2 回答
不幸的是,根据文档,在管道运行后删除所有工件:
https://confluence.atlassian.com/bitbucket/using-artifacts-in-steps-935389074.html
但是,您可以将工件部署到Bitbucket下载部分或其他任何位置:
https://confluence.atlassian.com/bitbucket/deploy-build-artifacts-to-bitbucket-downloads-872124574.html
在bitbucket-pipelines.yml中,无论何时进入不同的“
step:
”,它都会重置几乎所有内容,并独立地执行上一步 . 这并不总是显而易见的,并且可能令人困惑 .在上一步中,您使用
cd BackgroundCode
移动到子文件夹中 . When the script progresses to the "artifacts:" step, the current working directory will reset back to its original $BITBUCKET_CLONE_DIR . 所以你需要在每一步中再次cd BackgroundCode
或使用relative to the $BITBUCKET_CLONE_DIR的路径,如下所示:要么
现在,这将自动保存工件(7天),您可以在顶部的“工件”选项卡中看到它 .