We’re announcing two enhancements to Bitbucket Pipelines artifacts with:
- New artifact types: shared and scoped.
- Selective download: Specify which artifacts to download in a step.
New Artifact Types:
- Shared artifacts: Use shared artifacts for workflows that require sharing data between steps. These are accessible across multiple steps.
- Scoped artifacts: Scoped to each step and can’t be downloaded across steps. Scoped artifacts are ideal for files like log-files, test reports, screenshots, or videos generated during testing.
Selective Download:
You can now control which artifacts download in a step by specifying the download field as a list.
- Set
download: trueto download all artifacts from previous steps. - Set
download: falseto skip downloading any artifacts. - Set download to a list of artifact names to download only the specified artifacts. For example, to download only specific artifacts, use:
download:
- "Artifact 1"
- "Artifact 2"
Why use these new features?
- Save build minutes:
- Use scoped artifacts for step-specific items like logs and test screenshots. These won’t pass to next steps, saving time downloading them unnecessarily.
- For shareable artifacts, use selective download to get only the important artifacts needed in the step.
- You can now specify when to create an artifact based on step state to reduce time spent creating artifacts.
- Improve artifact organization: You can group multiple glob patterns in a single artifact, significantly reducing the number of artifacts to manage in the pipeline. There are fields available on new artifact types to specify glob patterns to ignore in an artifact and set search depth; adding flexibility and improving artifact organization.
Example: Pipeline YAML with new artifact types and selective download
pipelines:
default:
- step:
name: 'Step 1'
script:
- echo "upload one shared and one scoped artifact"
artifacts:
upload:
- name: "My application jar"
type: "shared"
paths:
- "target/*.jar"
depth: 2
- name: "Build logs"
type: "scoped"
paths:
- "logs/**"
capture-on: failed
- step:
name: 'Step 2'
script:
- echo "upload one more shared artifact"
artifacts:
upload:
- name: "My application jar 2"
type: "shared"
paths:
- "target2/*.jar"
- step:
name: 'Step 3'
script:
- echo "download only first artifact"
artifacts:
download:
- "My application jar"
Important information:
- 14-day retention:
Shared and scoped artifacts are also stored for 14 days similar to the previous ones. - 1 GB size limit:
Limit of 1GB per artifact would remain on these new artifacts. - User section in UI:
Artifacts using the old syntax would come under the User section in the artifacts UI - Self-hosted runner version:
To use the new artifacts types in a self hosted-runner, use a runner version latest thanv3.31.0
Feedback
We’re always keen to hear your thoughts and feedback – if you have any questions or suggestions on this feature, feel free to share via the Pipelines community space.