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'
The directory structure would be
'agent/build/Projects/[Projectname]/[Projectname].dacpac'.
The output of the pipeline says
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
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
In bitbucket-pipelines.yml, whenever you progress to a different "
step:
", it will reset almost everything and behave independently to a previous step. This is not always obvious, and can be confusing.In your previous step, you moved into a sub-folder using
cd BackgroundCode
. When the script progresses to the "artifacts:
" step, the current working directory will reset back to its original$BITBUCKET_CLONE_DIR
. So you need tocd BackgroundCode
again in each step or use a path that's relative to the$BITBUCKET_CLONE_DIR
, like this:or
This will now save the artifact automatically (for 7 days), and you can see it in the "Artifacts" tab at the top.