youngmon/atlassian-qna huggingface dataset:
How to set a requiremet for an executable in a Bamboo.yml file?
Asked by Tempfli Gell?rt:

How to set a requiremet for a job in a Bamboo.yml file? I've read the article here: <https://docs.atlassian.com/bamboo-specs-docs/6.3.0/specs-yaml.html?_ga=2.72707411.1568023111.1550773500-906756097.1547204974#job-requirements>

**But it does not help at all.**

When I write the name of an executable bamboo tells no agent can run this test (but in the list of the executables there are agents with that capability).

E.g.:

*requirements:*   
*- 'Doxygen (Linux)'*

Where Doxygen (Linux) is the name of an executable.


Answers:
author: Daniel Santos
body: Hi [@Tempfli Gell?rt](/t5/user/viewprofilepage/user-id/1233483)

You need to use the full capability key to make it work.  
When the requirement is configured through the UI, even though there is just a name there, it has the right key loaded in the background (DB). When using this type of configuration in specs you need to provide the right key.

I'll open a request to improve this feature so you don't need to use the full key name to make it work. [\[BAM-20322\] Setting a requirement in YAML specs leads to no agent can build this job.](https://jira.atlassian.com/browse/BAM-20322)

This is how you get the full key:

1. Go to **Admin \>\> Overview \>\> (Server capabilities** or**agent capability)**
2. **Hover the mouse** pointer over the **selected capability**
3. Check the name on browser **status bar**   
   Please notice that "+" (plus signs) need to be changed to spaces.  

   ![Screen_Shot_2019-02-26_at_18_11_53.png](https://community.atlassian.com/t5/image/serverpage/image-id/47083i9AE488719993DBE2/image-dimensions/504x231?v=v2 "Screen_Shot_2019-02-26_at_18_11_53.png")  

Please let me know if you have questions on this.

comments: author: Steffen Opel _Utoolity_
body: Excellent response, many thanks [@Daniel Santos](/t5/user/viewprofilepage/user-id/502125)!


author: Tempfli Gell?rt
body: Thanks [@Daniel Santos](https://community.atlassian.com/t5/user/viewprofilepage/user-id/502125)!


author: Daniel Santos
body: You are welcome, guys!
Artifact sharing from a failed build plan to a child plan
Asked by headerfile:

Hi,

I am using Bamboo's 'Artifact Downloader' plugin to share artifacts from a parent plan to a child plan. I have configured the child plan to run even if the parent plan failed. I notice that when the child plan is running, the 'Artifact Downloader' is downloading the artifacts from the last successful build of the parent plan. How do I make it download the artifact from the latest build (instead of the last successful build) of the parent plan?


Answers:
author: Daniel Santos
body: Hi [@headerfile](/t5/user/viewprofilepage/user-id/1036271)

This happens by design. In most cases, it won't make sense to get an artifact from a failed build. Depending on the failure the artifact won't even be published.

I do think the simpler way is to make sure your prior build plan succeeds before trying to run the plan that will consume the artifact. You could change your trigger by setting the option **Only run Build if other Plans are currently passing**and providing the correct plan key.

If you still want to try downloading the artifact from the latest build even if it is failed you may try it programmatically. For that you would need:

1. The PLAN-KEY from which the artifact is downloaded  
   ?? Please notice that depending on the plan branch the PLAN-KEY will be different
2. The BUILD-NUMBER of the plan you want the artifact  
   You could discover the latest one using something like:

   ```
   BUILD_NUMBER=`curl -u user:password -X GET 'http://localhost:8085/bamboo/rest/api/latest/result/PROP-PLEN-latest' | awk -v FS="(resultNumber)" '{print $2}' | tr -d '<>/'`
   ```

3. The artifact name
4. The artifact file
5. Download the artifact using the process from this other community question: [Dowload Plan Artifacts](https://community.atlassian.com/t5/Bamboo-questions/Dowload-Plan-Artifacts/qaq-p/965201#U967064)

I hope it helps.


Tags: artefact
How to invoke a Rest API from BAMBOO TASK?
Asked by Mareesh waran:

Hi, I'm new to Bamboo tool and am from JAVA developer.  

Can someone please help on the below...

As per my requirement, I need to create a Bamboo task and that task should invoke inhosue Rest API(<http://host:port/api/.....>.) (ZUUL API) to perform some business logic.

So, Where we have to mention a API URL in TASK and How Bomboo will invoke my API ?

Any way is there to achieve this?

Thanks,

Mareesh


Answers:
author: Jobin Kuruvilla [Adaptavist]
body: You can use the "script" task and use curl or something similar to make the REST call. You can also have a custom script on a remote server and execute it from Bamboo.

comments: author: Mareesh waran
body: [@Jobin Kuruvilla \[Adaptavist\]](/t5/user/viewprofilepage/user-id/781455) Thanks..., Now as per my requirement i'm invoking a JOB from my java code and in that job have configured one of script task that task is invoking one of my rest API. Now that rest API is post call and it is expecting a input. Right now i have static values but i need to send request object from my java code.

How can i send a request object to bamboo to execute that particular task?


author: Jobin Kuruvilla [Adaptavist]
body: Maybe you can define them as build variables and set the variables while invoking the build?


Tags: bamboo-app

bamboo-development
How to achieve continuous release cycle with Bamboo for Atlassian Plugin development?
Asked by Robhit Saxena:

Hi All,

I am developing Atlassian plugins and can package and deploy the plugins manually by using the atlas-\* commands.

However, I would like to automate this whole process of packaging and deployment as a release cycle using Bamboo.

I would like to achieve the following:

1. Using Maven task in the Bamboo to package my plugin. (This I am currently doing by using a script task and using the atlas-package command inside of it)
2. Using the maven task (if possible) to auto-increment the snapshot version of the build artifact. (Currently, I am doing this by using a script task and using the command "atlas-mvn clean package -DbambooBuildNumber=${bamboo.buildNumber}"
3. Using Bamboo deployment to deploy the generated artifact to the target servers and also to achieve the auto-increment of the maven version from the snapshot to the major for example, 2.0

I am kinda lost on how to achieve this and need help to proceed further.

Thanks in advance!


Answers:
author: Foong
body: Hi Robhit,
> Using Maven task in the Bamboo to package my plugin. (This I am currently doing by using a script task and using the atlas-package command inside of it)

Use Capability to add a Maven executable with atlas-mvn
> Using the maven task (if possible) to auto-increment the snapshot version of the build artifact. (Currently, I am doing this by using a script task and using the command "atlas-mvn clean package -DbambooBuildNumber=${bamboo.buildNumber}"

Maven task can be configured with "clean package -DbambooBuildNumber=${bamboo.buildNumber}" as the **Goal**
> Using Bamboo deployment to deploy the generated artifact to the target servers

Try this add-on [Continuous Plugin Deployment for Bamboo](https://marketplace.atlassian.com/apps/602870/continuous-plugin-deployment-for-bamboo)
> and also to achieve the auto-increment of the maven version from the snapshot to the major for example, 2.0

Try this add-on [Variable tasks for Bamboo](https://marketplace.atlassian.com/apps/1212549/variable-tasks-for-bamboo) to get the maven version and increment it and update pom.xml with command or Maven task like

    mvn versions:set -DnewVersion=${bamboo.maven.version.extracted.incremented}


Tags: atlassian-sdk

maven
Error: Unable to download artifact Shared artifact
Asked by Aditi7:

I am using Shared artifact feature of bamboo to share files from build plan to deployment project.

But when I run deployment project I am facing error "*Unable to download artifact Shared artifact*"

Bamboo version I am using is 6.3.2

Kindly look into this on high priority.


Answers:
author: Daniel Santos
body: Hi [@Aditi7](/t5/user/viewprofilepage/user-id/119910)

Can you check if the artifact was published in the origin plan? You should see a message like this in your deployment logs "

```
...Preparing to download plan result: PROJ-PLAN-BUILD#
```

Do you think you can share the logs from PROJ-PLAN-BUILD# and from the deployment?  
We only need the relevant part of it, the lines referring to the artifacts.

comments: author: Aditi Gaikwad
body: Deployment is taking old build no in

```
.Preparing to download plan result: PROJ-PLAN-BUILD#
```

It is not taking latest build number


author: Daniel Santos
body: The deployment will always try to get the artifacts from a specific build (the build which was released). Every deployment will deploy a specific release. If you try to rerun a deployment it will keep trying to deploy that specific release, in other words, the same old build.

The message I shared can be found in your deployment logs and will tell you what exactly build is the one being deployed. Using that build key you can check if that build has the artifact you need or if for some reason the artifact was not deployed.

Another option is to deploy a new release. There are some ways to do it, so let me share them:

**Create the release from the build result page and then deploy it**

1. You create a new release, by navigating to the build result you want to deploy:  

   ```
   <Bamboo_URL>/browse/PROJ-PLAN-BUILD#
   ```

2. Then click in **Create release**.
3. Navigate to your deployment and select the option to **Promote existing release to this environment**

**Create the release through the deploy page**

1. Navigate to your deployment and select the option to **Create a new release from build result**

You can even configure your deployment to create a release for every successful build by adding an **After successful build plan**trigger into your deployment environment.
Bamboo will run all the tests ignoring the cucumber tag
Asked by chun:

I use tag to run specific test suite in cucumber test. It works fine locally, but when I run the same command on bamboo, all the other tests like unit tests and acceptance tests all ran.

the maven command is:

mvn clean test -Dcucumber.options="--tags @regression" -Dtest="IntegrationTest"

Please help.

Thanks


Answers:
author: Foong
body: Maven task does not work well with quotes <https://jira.atlassian.com/browse/BAM-17709>


Tags: cucumber
Override plan variable using bash script.
Asked by Srinivas Dova:

Hi,

Please help me to override plan variable using bash script.

I can able to get the plan variable value. But not able to update this value.

Thanks in Advance.

--- Srini


Answers:
author: Foong
body: Use the Script task to save the modified value in a file and then use "Inject Bamboo variable" to replace it
Bamboo push tags
Asked by Oliv?r Sping?r:

I use maven release plugin for release generation. I use pushChanges=false and localCheckout=true options so every changes go to the local repo only. After it I run a Repository Push task, but it only push the commits. How can I push the tags too?


Answers:
author: Foong
body: Use another task "Repository Tag"

comments: author: Oliv?r Sping?r
body: I can't use this because this task makes new tag. I like to push the tag which the maven release plugin create during release generation.


author: Foong
body: Feature request <https://jira.atlassian.com/browse/BAM-20332>


author: Foong
body: Can try this add-on [Maven POM Value Extractor](https://marketplace.atlassian.com/apps/1211019/maven-pom-value-extractor) to get the tag value, use Script task to remove the created tag and then Repository Tag task to create and push the tag again.
Bamooo linking with IP address
Asked by HitBar:

This is what exactly I am facing the issue

<https://community.atlassian.com/t5/Bamboo-questions/Unable-to-connect-bitbucket-repository-from-bamboo/qaq-p/788372>

In the build plan I get the repository of bitbucket, I gave SSH private and public keys but I cannot access the bitbucket I get the same error

I do not want to use localhost:8085 need to know how can I get bamboo ip address so that I can configure that instead of localhost

Thanks,

Hitendra


Answers:
author: Daniel Santos
body: Hi [@HitBar](/t5/user/viewprofilepage/user-id/2640232),

The post you shared talks about a problem between Bamboo and Bitbucket cloud. Are you facing an issue with **Bitbucket Cloud** or **Bitbucket Server**?

I don't get where you would use the Bamboo IP for that configuration. Can you explain it a little more?

If this issue is with **Bitbucket cloud:**

* Are you able to load the repositories?
* Is this the first time you configure this?
* Can you share a screenshot of your configuration?

If this is an issue with **Bitbucket server:**

* Can you share how your Bamboo connector is configured in **\<Bamboo_Install\>/conf/server** .**xml** file?
How to start learnign Bamboo
Asked by Karthick G:

Can I get any documents or videos to learn Bamboo.


Answers:
author: Grigory Salnikov
body: Hi [@Karthick G](/t5/user/viewprofilepage/user-id/2755703) and welcome to our Community.

Here's a good point to start from:

[Getting started with Bamboo](https://confluence.atlassian.com/bamboo/getting-started-with-bamboo-289277283.html)
YAML code to skip branch based builds
Asked by ilarumk:

Hi,

I am using Bamboo Specs YAML in the repository to build the plan for my repository. However whenever I create a branch, Bamboo builds the job.

Is there a way I can have a specify not build for any branches and run it only for master? (which is what I configured in linked repository)

How can I do this in yaml configuration or even any setting anywhere else.

I could think of two ways:

1. One way I could achieve this is to write a shell script and skip the code if branch is not master (it still executes)

2. have few things in environment variables and use them as parameters, so master build does always things in production and branches will be using a different configuration.


Answers:
author: Foong
body: Feature request <https://jira.atlassian.com/browse/BAM-20320>

Use Bamboo Java Specs that have Automatic Branch Detection configuration instead of Bamboo YAML Specs.
Linux client: how to access X11 display ?
Asked by Jean-Dominique GASCUEL:

I have a bamboo client, installed on linux, running some OpenGL test:  
compilation is OK.  
But when execution starts, everything crash. When trying to start the GUI, it requires access to the X11 display. Which is locked because the bamboo user does not own the display ...

So anyone have an idea how to allow display access from an application started by bamboo ?

Thanks


Answers:
author: Steffen Opel _Utoolity_
body: You need to run the X11 display server in a headless fashion, which is commonly achieved via the [X virtual framebuffer (Xvfb)](https://en.wikipedia.org/wiki/Xvfb).

Not 100% positive on this, but I think Xvfb is included on the [stock Bamboo Elastic images](https://confluence.atlassian.com/bamboo/stock-images-289277463.html) (despite the lack of a preconfigured capability), either way none of this is properly documented. You can find resp. hints via [Populating your EBS volume](https://confluence.atlassian.com/bamboo0606/administering-bamboo/working-with-elastic-bamboo/configuring-elastic-bamboo/configuring-elastic-instances-to-use-the-ebs/populating-your-ebs-volume) and [BAM-16951](https://jira.atlassian.com/browse/BAM-16951), which should translate to [custom Bamboo Elastic images](https://confluence.atlassian.com/bamboo/creating-a-custom-elastic-image-289277146.html) and regular remote agent scenario conceptually.

Similarly, you should also be able to apply these Xvfb patterns to a custom Docker image for use with the [Bamboo Docker runner](https://confluence.atlassian.com/bamboo/docker-runner-946020207.html) or [Bamboo Docker task](https://confluence.atlassian.com/bamboo/configuring-the-docker-task-in-bamboo-720411254.html), in case it isn't included in the default Bamboo Docker images already. You can find resp. hints via [Gui tests on xvfb, initialisation and cleanup](https://community.atlassian.com/t5/Questions/Gui-tests-on-xvfb-initialisation-and-cleanup/qaq-p/379615).

Sorry for not being more specific, hope it helps to get you on the way.

comments: author: Anil Unnikrishnan
body: Does this work on local agents as well? Or does it need to be remote?


Tags: linux

server
How to publish multiple plans in one Java Spec?
Asked by FrostRed Lee:

<https://community.atlassian.com/t5/Bamboo-questions/Bamboo-specs-yaml-Create-different-plans/qaq-p/774703>

I am from this question. I have tried Java Spec, but it seems bambooServer.publish(plan) only take effect once.


Answers:
author: FrostRed Lee
body: it's my mistake, bambooServer.publish(plan) can call for different plan


Tags: java
How to run my tests in docker container and what remote agents should i use?
Asked by Harsha Rao:

I'm creating a pipeline in bamboo and I want to create a task that uses my docker file to create a docker container with all the tools, sys req

The docker file is located in my source code repo to create a docker container

Then next step is to run the docker container

In that container i need to run my test scripts and once the tests are completed store the results in my local artifact repo

For the above scenario:

How do i push my test scripts into the docker container?

If my test data is in Excel format can i use it in Docker container?

What agents should i use ? can i use exiting stock (docker Elastic)


Answers:
author: Foong
body: > How do i push my test scripts into the docker container?

The mount setting can be used so that docker container is able to access the test scripts.
> If my test data is in Excel format can i use it in Docker container?

If the test scripts works fine in command line only, there won't be any problem running it in Docker container.
> What agents should i use ?

The agent will need to have Docker installed in the machine.
> can i use exiting stock (docker Elastic)

It will depend on your test environment.


Tags: bitbucket
Adding a label to build automatically
Asked by sangeeta:

We need to add a label to build . The label we need is the version number of build .

This version information is stored in a file .

How can we achieve this: after every build it gets labelled using the version number specified in a properties file .


Answers:
author: Daniel Santos
body: Hi [@sangeeta](/t5/user/viewprofilepage/user-id/1177012)  

This article has the information you are looking for: [How can I attribute a label to a Bamboo build result based on its outcome (success or failure)?](https://confluence.atlassian.com/bamkb/how-can-i-attribute-a-label-to-a-bamboo-build-result-based-on-it-s-outcome-success-or-failure-901028551.html) You will just need to change the script a little to get the version details from your properties file.  

Another path you could follow, probably simpler, would be printing the version information from your properties file during the build and using the method described in this other article: [Configuring automatic labeling of job build results.](https://confluence.atlassian.com/bamboo/configuring-automatic-labeling-of-job-build-results-289277081.html)  

Please let us know if that addresses your issue.


Tags: label
bamboo fails to start after upgrading 6.6.0 to 6.8.0
Asked by Qcast:

on starting the new bamboo version the catalina.out log says and it hangs:

* \[JohnsonFilter\] The application is not yet setup. Redirecting request from '/rest/capabilities' to '/bootstrap/selectSetupStep.action'
* \[AccessLogFilter\] 100.64.30.11 GET <http://bamboo.qcast.nl:8085/bootstrap/selectSetupStep.action> 397575kb
* \[SelectSetupStepAction\] Current setup step is /setup/complete.action

please help me to perform / finish the upgrade.

rgds Paul


Answers:
author: Daniel Santos
body: Hello [@Qcast](/t5/user/viewprofilepage/user-id/470582),  

I could see that you resolved this issue already with our support and I just wanted to check if you don't mind sharing the solution here.

Thanks!

<br />

comments: author: Peter N
body: [@Qcast](/t5/user/viewprofilepage/user-id/470582) , [@Daniel Santos](/t5/user/viewprofilepage/user-id/502125) I'm having the same problem. Any suggestions?


author: Qcast
body: Hi Peter,

i did not include the mySQL driver in the new Bamboo install folder:

1. Stop Bamboo 6.8
2. Check your old installation directory, folder: \<Bamboo installation directory\>/lib
3. Look for a file that looks like \* mysql-connector-java....jar\*.
4. Copy it in the new installation directory respecting the same path.
5. Start Bamboo again.

and also, 6.8 didn't want to start without a valid support license, which i needed to add manually:

```
2019-02-19 12:08:14,231 FATAL [localhost-startStop-1] [DefaultBootstrapManager] Unable to run pre-bootstrap upgrade tasks as your support period has ended
```

Paste your new license in the file \<bamboo-home\>/bamboo.cfg.xml, section **property name="license.string"**.

these 2 steps did the trick for me, good luck.


author: Daniel Santos
body: Thank you for taking the time to share your solution here [@Qcast](/t5/user/viewprofilepage/user-id/470582) We really appreciate that =\]

[@Peter N](/t5/user/viewprofilepage/user-id/473154), the error you see may have multiple sources. It is very common that this is caused by a missing driver, but it could be something else. You need to look for the first errors that show up in your logs. They usually will give you better clues on what is happening. In Paul's case, we were able to see the driver error happening first, the same thing for the license issue.


author: Peter N
body: The main issue was that license. We had a support valid license on my.atlassian.com but we hadn't applied it. At least that got us past the infinite redirect loop. I've got the next issue to resolve. Working with support for that.


author: Daniel Santos
body: That is great [@Peter N](/t5/user/viewprofilepage/user-id/473154)

Thank you for updating this thread when you found out the issue.
SVN revision of last successful build in Bamboo
Asked by Bharath:

I have a requirement to get the SVN revision of the last successful build. How do I get that?

Thank you.


Answers:
author: Alexey Chystoprudov
body: Try command

```
curl -H "Accept:application/json" https://localhost:8085/bamboo/rest/api/latest/result/PLAN-KEY?buildstate=Successful\&max-results=1\&expand=results.result.vcsRevisions
```

and then check vcsRevisions node


Tags: build

svn