How to pass custom metadata to bamboo jobs and plan

sangeetha November 17, 2018

I found an option of injecting the  metadata key  value into properties file via script task (creating the properties file) and inject variable task . But is there any other  option of passing the custom meta data without creating a file.

1 answer

0 votes
Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 23, 2018

Hi @sangeetha,

If you want to create a variable with data that is generated during the build, that is the way we do it.

Can you elaborate more on what you are trying to achieve? We might be able to find a different path to solve your demand without creating the metadata.

Victor Lopez December 18, 2018

I want to track size of my javascript bundles within the plan. Is there a way to solve it using the metadata?

Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 20, 2018

I guess not.

Have you thought using artifacts for that?

You can save whatever information you need into a file and create an artifact with it. Once that is done you can load that artifact in other stages of the same plan or even in different plans.

Does that make sense?

Victor Lopez December 20, 2018

Sorry, I'm newby in the CI. How can I use artifacts? 

I'd like to make a report, like Clover, to see visualization of build size. May be I can customize Clover to use some additional values

Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 21, 2018

Considering that you are new in Bamboo I would try understanding better how to work with artifacts to check if that is an option to solve your problem.
Here you can find some references about it:

If you realize it will not be helpful then you can try the customisation path, but that will be a harder path. You will need to develop a Bamboo plugin your own.
This is our developer documentation:

There is also something not clear to me. When you say build size, what size are you talking about?

Victor Lopez December 26, 2018

Artifact for me is a docker container. During the build my code compiles and several compiled files are created in the "dist" folder of the container. I need to monitor the size of the compiled files.

Thanks for the links

sangeetha January 6, 2019

Actually , I am trying to move the artifacts from pre-release folder to release folder with the version information. Currently  we were told that this can be done using move artifacts option across repositories which is available only for admins and not  to us(we dont have admin access). One of the option was to  save the release number into a file and use the bamboo inject variable plugin to read the file during deployment.  Is there any  option available instead of creating a file.

Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 7, 2019

Hi @sangeetha,

I don't know the option of moving artifacts or something similar to it. Usually we publish artifacts and download them. Manipulating artifacts not using the download task will require managing physical folder locations that can even be in different agent servers.

I would try to manage the version of the artifact on the artifact itself. You could for example publish the artifact with its version (on the artifact file name), download it in a different plan/deployment, use the version information from it (extracting using a simple script task) and renaming the artifact if needed.

Versions of artifacts should be attached to the artifact itself, or the repository version. This would assure you that you have the exact information/artifact you need when releasing it. 

Abhishek Mozumder
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 22, 2019

Hello @Daniel Santos  i want to pass on a custom metadata to the deploy job how can i do that.  i have intentionally removed few of our other variable parameters. I want to use the Jira Ticket # in a deploy job.Capture.JPG

Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 26, 2019

Hi @Abhishek Mozumder

Do you want to run the deployment, but customizing the variable when starting it?
Or do you want to inherit the customized variable from the plan metadata?

If you want just to load a custom variable from a build plan, you should just reference it in the deployment. It should be able to use it as:

${bamboo.JiraTicket}

But if you want to run the deployment with a different option that will allow you to change the variable right at the moment the deployment is started, then you will probably need this add-on: Custom Deployments for Bamboo | Atlassian Marketplace

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events