Artifacts in Bamboo Server
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Purpose
The information on this page is an extension to Locating important directories and files, which describes how Artifact Sharing and GlobalStorage are kept in the Bamboo's Home directory.
Shared/Unshared artifacts
When Configuring a job's build artifacts, you are able to make it consumable OR not by - the same plan, other plans, deployment environment. What defines this feature is the Shared in the Artifacts >> Create definition view, which Make the artifact available to be used in other builds and deployments.
Once having a successful build that produced an artifact, you can run the following SQL statement to check where the same can be found under the <bamboo-home>/artifacts
directory:
Plan directory information
If some of your tasks require direct access to build artifacts, you can enable REST endpoint to access this information. More details at page Plan directory information REST API
GlobalStorage
You may find a directory called globalStorage under "<bamboo-home>/artifacts
".
Directories under globalStorage are created when:
- the shared artifact generated by a build has been consumed by a Deployment (Sharing artifacts from a build plan to a deployment environment) AND;
- the build result that originally produced the shared artifact has been deleted (Deleting the results of a plan build) OR expired (Configuring global expiry or Configuring expiry of a plan's job build results).
These artifacts are moved to the globalStorage in case they are referenced by a Deployment version - so they are skipped from being removed.
select ARTIFACT.ARTIFACT_ID,
ARTIFACT.PLAN_KEY as BUILD_KEY,
ARTIFACT.BUILD_NUMBER,
ARTIFACT.CHAIN_ARTIFACT as SHARED
from ARTIFACT
where GLOBALLY_STORED = TRUE
order by PLAN_KEY, BUILD_NUMBER;
ARTIFACT_ID | BUILD_KEY | BUILD_NUMBER | SHARED |
---|---|---|---|
8585219 | PROJ-PLAN | 3 | true |
With the information above, you can check if the artifact is listed under "<bamboo-home>/artifacts
" directory:
ARTIFACT_ID | BUILD_KEY | BUILD_NUMBER | SHARED | Directory structure |
---|---|---|---|---|
8585219 | PROJ-PLAN | 3 | true | <bamboo-home>/artifacts/globalStorage/8585219/ |
To understand which Deployment Project, Environment and Releases are still referencing artifacts within globalStorage, you can use the below SQL query to get the ARTIFACT_ID
to map back to the contents of <bamboo-home>/artifacts/globalStorage
:
SELECT DP.Name as DeploymentProject, DE.name as Environment, version_name, A.plan_key as ArtifactSourceBuildPlan,
A.build_number as ArtifactSourceBuildNumber, A.artifact_id, a.artifact_size, a.globally_stored, a.link_type
FROM ARTIFACT A
JOIN DEPLOYMENT_VERSION_ITEM_BA DVIB ON A.ARTIFACT_ID = DVIB.ARTIFACT_ID
JOIN DEPLOYMENT_VERSION_ITEM DVI ON DVIB.VERSION_BAM_ARTIFACT_ITEM_ID = DVI.DEPLOYMENT_VERSION_ITEM_ID
JOIN DEPLOYMENT_VERSION DV ON DVI.DEPLOYMENT_VERSION_ID = DV.DEPLOYMENT_VERSION_ID
JOIN DEPLOYMENT_PROJECT DP ON DV.PROJECT_ID = DP.DEPLOYMENT_PROJECT_ID
JOIN DEPLOYMENT_RESULT DR ON DV.DEPLOYMENT_VERSION_ID = DR.VERSION_ID
JOIN DEPLOYMENT_ENVIRONMENT DE ON DE.ENVIRONMENT_ID = DR.ENVIRONMENT_ID
WHERE GLOBALLY_STORED IS TRUE
ORDER BY ARTIFACT_SIZE, ARTIFACT_ID