Artifacts in Bamboo Server

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server と Data Center のみ - この記事は、サーバーおよびデータセンター プラットフォームのアトラシアン製品にのみ適用されます。

目的

The information on this page is an extension to Locating important directories and files in 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, in which Make the artifact available to be used in other builds and deployments.

Once having successful build in which produced an artifact, you can run the following SQL statement to check where the same can be found under the "<bamboo-home>/artifacts" directory:

Prior bamboo v5.12.x
select ARTIFACT.ARTIFACT_ID,
	   BUILDRESULTSUMMARY.BUILD_KEY, 
       ARTIFACT.BUILD_NUMBER, 
       ARTIFACT.CHAIN_ARTIFACT as SHARED
  from ARTIFACT
  join BRS_ARTIFACT_LINK on BRS_ARTIFACT_LINK.ARTIFACT_ID = ARTIFACT.ARTIFACT_ID
  join BUILDRESULTSUMMARY on BUILDRESULTSUMMARY.BUILDRESULTSUMMARY_ID = BRS_ARTIFACT_LINK.PRODUCERJOBRESULT_ID
 where GLOBALLY_STORED = FALSE
 order by PLAN_KEY, BUILD_NUMBER;
ARTIFACT_ID

BUILD_KEY

BUILD_NUMBER

SHARED

8585217

PROJ-PLAN-JOB1

1

true

8585218

PROJ-PLAN-JOB1

2

false

With the information above, you can check where the artifact is listed under "<bamboo-home>/artifacts" directory:

Directory structure

<bamboo-home>/artifacts/PROJ-PLAN/shared/build-00001/

<bamboo-home>/artifatcs/PROJ-PLAN/JOB1/build-00002/

In Bamboo v5.12 and above
select BUILD.BUILD_TYPE,
       FULL_KEY,
       ARTIFACT.BUILD_NUMBER,
       ARTIFACT.CHAIN_ARTIFACT as SHARED,
       STORAGE_TAG
  from BUILD
  join ARTIFACT on BUILD.FULL_KEY = ARTIFACT.PLAN_KEY
  join BRS_ARTIFACT_LINK on ARTIFACT.ARTIFACT_ID = BRS_ARTIFACT_LINK.ARTIFACT_ID
  join BUILDRESULTSUMMARY on BUILDRESULTSUMMARY.BUILDRESULTSUMMARY_ID = BRS_ARTIFACT_LINK.PRODUCERJOBRESULT_ID
 where GLOBALLY_STORED = FALSE
 order by PLAN_KEY, BUILD_NUMBER, SHARED;
BUILD_ID

BUILD_TYPE

FULL_KEY

BUILD_NUMBER

SHARED

STORAGE_TAG

950273

CHAIN

PROJ-ART

1

true

plan-950273

950273

CHAIN

PROJ-ART

2

true

plan-950273

950273

CHAIN

PROJ-ART

3

true

plan-950273

950275

CHAIN_BRANCH

PROJ-ART0

1

true

plan-950275

950275CHAIN_BRANCHPROJ-ART02trueplan-950275
360449

CHAIN

PROJ-PLAN

1

true

PROJ-PLAN

360449

CHAIN

PROJ-PLAN

2

true

PROJ-PLAN

360449

CHAIN

PROJ-PLAN

4

true

PROJ-PLAN

360450

JOB

PROJ-PLAN-JOB1

3

false

(null)


With the information above, you can check where the artifact is listed under "<bamboo-home>/artifacts" directory:

Directory structure

コメント
<bamboo-home>/artifacts/plan-950273/shared/build-00001/This SHARED artifact relates to build ran against MASTER plan branch.
<bamboo-home>/artifacts/plan-950273/shared/build-00002/
<bamboo-home>/artifacts/plan-950273/shared/build-00003/
<bamboo-home>/artifacts/plan-950275/shared/build-00001/This SHARED artifact relates to build ran against FEATUTE plan branch.
<bamboo-home>/artifacts/plan-950275/shared/build-00002/

<bamboo-home>/artifacts/PROJ-PLAN/shared/build-00001/

This SHARED artifact relates Artifacts generated from a bamboo version prior Bamboo v5.12.x.
<bamboo-home>/artifacts/PROJ-PLAN/shared/build-00002/
<bamboo-home>/artifacts/PROJ-PLAN/shared/build-00004/

<bamboo-home>/artifatcs/PROJ-PLAN/JOB1/build-00003/

This UNSHARED artifact relates Artifacts generated from a bamboo version prior Bamboo v5.12.x.


Also since Bamboo 5.14.4 storageTag variable in build results can be used to determine artifact path.


The variable which can be used to get the storage tag is: "${bamboo.plan.storageTag}" (The storage tag is static and won't change for a plan.)



Plan directory information

If some of your tasks require direct access of 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:

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

最終更新日 2018 年 11 月 2 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.