youngmon/atlassian-qna huggingface dataset:
Docker runner with custom run commands
Asked by Mark Kewley:

Hello,

Is it possible to use the new Docker runner feature with specific run arguments for docker? (e.g. adding the --privileged flag).

When building a plan and configuring a build job, the docker container task has the ability to add arguments to the run command. Wondering if we can do something similar.

![Screen Shot 2018-03-26 at 1.07.30 PM.png](/t5/image/serverpage/image-id/17943i99DCD749FC91501E/image-size/large?v=v2&px=999 "Screen Shot 2018-03-26 at 1.07.30 PM.png")

Thanks!


Answers:
author: Ellie Z _they_them_
body: Hi Mark,

Thank you for reaching out to the Atlassian Community regarding Docker Runner!

Unfortunately, it's not possible to use Docker runtime arguments with Docker Runner at this time.

I do understand that we can do this with the Docker Tasks in Bamboo, and I have created a Feature Request, linked below, which I strongly encourage you to vote, watch, and comment on:

[\[BAM-19793\] Allow use of arguments for Docker Runner](https://jira.atlassian.com/browse/BAM-19793)

Please don't hesitate to reach out if you have any other questions!

Cheers,

Elias \| Bamboo Support


Tags: docker
How can we migrate Bamboo to run as a service rather than through a user account without having to r
Asked by Dan Gorman:

When we started using Bamboo it was created using an individuals Active Directory login and running it through the console, without thinking about the ramifications of that. We would like Bamboo to run as a service, but when it is started as a service instead of in console and associated with an individual user. When we run it as a service now none of the jobs or configuration show up. The main issue is if there is any trouble shooting that needs to be done on the server it has to be done by the user who was set up Bamboo, which is not sustainable.

We hoped to either create a generic active directory account and transfer stuff over and run Bamboo in console or as a service it would not be much more trouble.


Answers:
author: Christian Glockner
body: Hi Dan,

If Bamboo goes to the setup wizard when started as a service, the most likely explanation is that the user the service runs under doesn't have permission to read the Bamboo home directory, so that's what I'd be looking at.

There is nothing that should prevent Bamboo from running as a service using an Active Directory account.

Cheers,

Christian

Premier Support Engineer

Atlassian

comments: author: Dan Gorman
body: Thank you for your quick response Christian! For clarification running as a service my normal Bamboo homepage shows up as it always does. It displays the projects, plans recent build information etc. I get an internal server error message within Bamboo when I try to edit or drill down into a plan with any detail. I have made sure that the Windows User has permissions to the Bamboo home directory and installation directory. Any other thoughts?

Thanks!
Saving build log doesn't save entire log
Asked by Nima Rafiei:

I'm succesfully saving the build log using the \`wget\` version of the \`curl\` example \[here\](<https://confluence.atlassian.com/bamkb/how-to-save-a-build-log-as-an-artifact-892498832.html>)

And it works. But,

the saved log doesn't contain the entire log. Ok, so I'm aware that it won't save the very end of the log since after the finale stage (i.e. the saving stage) artifact are being stored and that produces some log. Thing is, the log I'm saving isn't saving more than like two stages before the final stage is called. That's where my log ends.

I've tried delaying using \`sleep\` \`timeout\` and \`ping\` up to 30s without any improvement to the content of my saved log.

___________________________

REPHRASING:

Tried saving the build log using:

```
wget -O my_build_log.txt --user=myuser --password=mypassword http://bambooserver/download/${bamboo.buildKey}/build_logs/${bamboo.buildResultKey}.log
```

and it works, but it does not save the log produced up until the wget-call is executed... it saves the log from a while before the call.  
I've tried adding

```
sleeptimeoutping
```

to delay the call to wget up to 60s.. doesn't help.

___________________________

Question 1: Is there a better way to save the log (so that I at least get log text up to where the saving stage takes place)?

Question 2: What is like the "refresh rate" of the log by Bamboo? Because it seems to update the log in intervals, but I don't know if it's time dependant or task dependant


Answers:
author: Ellie Z _they_them_
body: Hi Nima,

Thanks for reaching out to the Atlassian Community today! Please allow me to address your questions inline, below.
> Question 1: Is there a better way to save the log (so that I at least get log text up to where the saving stage takes place)?

Unfortunately this is currently the only known way of retrieving the logs while the build is running. The logs are streamed over the Java Message Service, and they are passed via a buffer, which does take some time to show. The only alternative would be to access the logs from the filesystem, but these would be the same as those we retrieve using cURL or wget.
> Question 2: What is like the "refresh rate" of the log by Bamboo? Because it seems to update the log in intervals, but I don't know if it's time dependant or task dependant

The log is technically refreshed every second, however, data that is in the buffer may not show right away. The log is indeed updated in intervals, but the interval is based on the buffer.

If possible, could you please try with a longer sleep command, maybe in a task of its own?

If you have any other questions, please don't hesitate to reach out!

Thanks,

Elias \| Bamboo Support

comments: author: Nima Rafiei
body: Thank you for your answer.

The extra delay doesn't seem to help enough, and adding even more delay is not pretty :)

As a workaround, I'm going to create a separate plan as a final stage which collects all logs from relevant plans.
How and where to store supporting files required by Bamboo build?
Asked by Deter Dangler:

I built a plan in Bamboo to deploy any changes in master branch to our test environment.

To deploy changes, we have a complex process and it requires couple of files accessible to Bamboo. Because I don't know how and where to store these files, for now, we kept those files in master branch.

If someone pushes a commit by deleting one of these two files then our build fails because Bamboo build uses these two files to deploy code into destination environment.

These two files shouldn't be part of the repository but instead should be in a location accessible only to Bamboo build process.

Any suggestions for this?


Answers:
author: Deter Dangler
body: Any suggestion?

comments: author: Anonymous Coward
body: Simon says:

" You mentioned that the files that you require for the builds should not be in the repository. I am not sure what structure the files have but in Bamboo you could use the Variables task (<https://confluence.atlassian.com/bamboo/configuring-a-variables-task-687213475.html>), with the only limitation that there is an assumption made by this task that the structure of the file is key-value pairs.

The steps that you could use are:

1. Format the information in the files as key-value pairs to comply with the Variables task assumption mentioned above.

2. In your build plan use a script task (or a SCP task) to copy the files to the Bamboo server, unless they are alreaddy present on it somewhere on the filesystem.

3. In your Build plan use Variables tasks to read the information from the files into the Bamboo environment accessible to the build plan. You will need to use one Variables task for each file.

4. Use other types of tasks to complete your build plan.

"

I hope this helps.
Variables should be set to project level
Asked by Bill Wang:

Bamboo server is used as CI/CD pipeline for the whole company (huge users). The permission to my application team are very strict.

There are two places we can define variables, especially for the secure variables.

One place is done by Bamboo admin to set the global variables. but the problem is, it is not in our team's control at all, and there is no way I can list the global variables' keys.. I have to ask Bamboo admin to provide the details, which takes time. Second, they change the keys' value at any time without notification.

Second place is done at each build job. It is in our control, but it is not convenience for us at all. A lot of same keys are set to each plan in my project. Some time, we forget update some of them.

So I think to **set variables to project level is obvious feature**, but I can't find any way to do that.

Is there any ways to manage variables in project level? So all plans created under this project can inherit these variables automatically.


Answers:
author: Alexey Chystoprudov
body: There's no such functionality. You can vote and watch at <https://jira.atlassian.com/browse/BAM-11092> to be notified when this issue will be addressed

comments: author: Bill Wang
body: Thanks for your reply, that's a 6 years old feature request.

If this is a feature asked for 6 years before, what's the point to vote it now? Does Atlassian mention in any where that how many votes your team start working on it? 100, 1000 or 10k? If it can be written down clearly, then I am happy to vote it and ask more to vote it.

Then will it be the only way to judge if your team will work on it or not?

Does Bamboo or Atlassian really care the customers who think this type of feature can be wait for 6 years without any actions or change the way to continuous improving the product and happy to do it with positive attitude and add it directly, more than waiting the votes?

I start understanding why so many staffs in our company to complain it, I have no other choice because of current company's policy, but this attitude to your paid customers makes me sick. If I have the right, the first thing to deal with the whole DevOps design with CI/CD pipline, Bamboo will be taken out of the plan without any hesitated.


author: Bill Wang
body: deleted? why I care of it.


author: Bill Wang
body: It is the life we need deal with. This is not that important at all.

Move on.


author: Jeyanthan I
body: Hi Bill,

We prioritise a feature request based on multiple factors. For your reference, you can find our policy on how we prioritise feature and improvement requests at [this page](https://confluence.atlassian.com/display/DEV/Implementation+of+New+Features+Policy). If you do not see an activity in a tracker, it could be that it did not meet enough popularity.
how to see and identify the status of bamboo backup process in logs?
Asked by Germ?n Rojas:

We want to upgrade and install the new version of our bamboo server instance, we are making a full backup of our instance, when the backup process starts is everything well, but I do not have any idea **what is happen in background** , i have access to all logs on the filesystem but the "**catalina.out** " log, and "**atlassian-bamboo.log** " ++**do not show anything about that**++ . **how to see and identify the status of our backup process?**

**our version (version 5.6.1 build 4410 - 19 Aug 14)**


Answers:
author: Jeyanthan I
body: When you say that you're taking a backup of Bamboo, I believe you are referring to the export process. Generally, the progress can be seen by tailing \<bamboo-install\>/logs/catalina.out

Don't you have access to see it there?

comments: author: sravani
body: I am also facing the same issue.


author: sravani
body: backups are failing in bamboo. Could you please help me how to fix the issue.

Version 6.6.1 Build number 60605


Tags: backup

log
How to kick off merge job after APPROVED pull request
Asked by Adam Hyatt:

New to BitBucket and Bamboo; I'd like to have the following process:

1) Dev's create branch off master, complete task

2) Dev creates pull request for branch and attaches reviewers

3) Code Review occurs, may need additional changes, eventually branch is approved

4) Bamboo triggers merge of branch into master once pull request is approved

Currently the build triggers after a pull request is created, but the result is kicking off a merge before the code review is approved. Is their a way to configure this behavior? If not, what is the best way I can accomplish the above flow?


Answers:
author: Foong
body: Actually, Bamboo and Bitbucket integration is designed to have the following flow:

1. Pull Request created
2. Bamboo perform merge build (do not configure it to perform push for successful build)
3. Reviewer for the Pull Request can see if there is any error with the build after the merge (this merge isn't push to Bitbucket yet)
4. Reviewer approve the Pull Request
5. Reviewer or user with permission to merge it will click on the Merge in the Pull Request

At the moment, Bamboo Branch plan will run automatically when it is created.

Refer to the following feature request:

<https://jira.atlassian.com/browse/BAM-12692> (which is related to <https://jira.atlassian.com/browse/BAM-12451>)
Cannot connect to the Docker daemon
Asked by Isa_Baboo:

Hi

I am running Bamboo 6.3.2 on RHEL7. I have a Deployment task to build an docker images. However the deployment is failing with the error **Cannot connect to the Docker daemon. Is the docker daemon running on this host?**

I have change the docker socket files groups to dockerroot and added the bamboo user to dockeroot

srw-rw----. 1 root dockerroot 0 Mar 23 14:38 /var/run/docker.sock

id  
uid=168(bamboo) gid=166(bamboo) groups=166(bamboo),164(dockerroot)

I can also execute the build command successfully from command line as the bamboo user.


Answers:
author: MB
body: Hi Isa,  

Your current session may not pick up these changes. After the installation, you should restart bamboo so the docker options can be picked up by Bamboo Server. Ensure the bamboo user is added to the docker group.   

Ensure the docker capabilities are also defined in the server too, [this](https://confluence.atlassian.com/bamboo/defining-a-new-docker-capability-720411323.html) could help.   

Cheers,  
Max - Premier Support Engineer


Tags: docker
How to use "Run customize build" option for SSH task?
Asked by Suvankar Dey:

When we want to run a single SSH task for multiple env, is there any way to pass parameter in SSH task while running through "run customize build" option ?


Answers:
author: Jeyanthan I
body: Hi Suvankar,

There appears to be no option to pass custom parameters to an SSH task.

If your intention is to connect to multiple environments via SSH, what you can do is to use a Script task and define your custom environment using [plan variables](https://confluence.atlassian.com/bamboo/defining-plan-variables-289276859.html) in **Configure plan -\> Variables(tab)** and define the environment hostname like below

```
host= env1hostname
```

and use this variable in your script task

```
ssh://${bamboo.host}
```

Now, you can choose Run customized and give a hostname of your preference to override the hostname variable for that build. See [Triggering a plan build manually](https://confluence.atlassian.com/bamboo/running-a-plan-build-manually-289276898.html) for more info
How to save a file with multi lines to a variable
Asked by Bill Wang:

I need save a file to variable for one bamboo server build plan

In build, I need echo the variable and save to a file which I want to get exact format.

How to do that?

echo "${bamboo_key}" \> /key


Answers:
author: Bill Wang
body: I fixed it by myself.

cat file \|base64 # in some OS, the output are multiple lines as well, just remove "\\n"

then copy the string into the variable in bamboo plan

When run the build, add below line

echo ${bamboo_key}\|base64 -d \> /key
Plan Branch not automatically Created in bamboo when new branch is created in Bitbucket Repository?
Asked by Vishal Srivastava:

We're new to Bamboo and not sure why the new branch doesn't pull up a plan in Bamboo... The Plan configuration says that it should auto-create a plan, but this is not occurring. Nonetheless, we can manually create our plans in the meantime but i need a automatic plan. May be a configuration Issue.

![plan bamboo.JPG](/t5/image/serverpage/image-id/17783i327107045588DC92/image-size/large?v=v2&px=999 "plan bamboo.JPG")We also have a working Application Link too

![applink.JPG](/t5/image/serverpage/image-id/17785i75B439F2C14A5182/image-size/large?v=v2&px=999 "applink.JPG")


Answers:
author: Jobin Kuruvilla [Adaptavist]
body: Config looks good. Are you seeing any error in the logs? On either side (Bamboo and Stash)?

Since you are seeing plan branches in Bamboo, I assume Bamboo to Stash is working fine. Maybe the other direction has some issues?

comments: author: Vishal Srivastava
body: Hi [@Jobin Kuruvilla \[Adaptavist\]](/t5/user/viewprofilepage/user-id/781455),

I have updated my Bitbucket Server to 5.10.1 and now its working fine.


author: Jobin Kuruvilla [Adaptavist]
body: [@Vishal Srivastava](/t5/user/viewprofilepage/user-id/1147558)Good to know :)


Tags: bamboo-administration

bamboo-development
Building only selected projects in Visual Studio solution
Asked by Ahmet Sertan Y?ld?r?m:

We have a huge Visual Studio (2017) solution under one git repository and mutiple teams have their projects in it.

Let's say Team A has an ASP.NET Web Portal project - \> Project 1

And Team B has a REST API project -\> Project 2

These two teams would like to do CI on their own projects.

* Visual Studio Solution
  * Project1
  * Project2
  * .
  * Project N

So, when configuring a build plan, can we specify bamboo just to build Project 2 and dependencies but do not build and deploy anything belongs to Project1?

Because the main issue is ( actually very rare) sometimes someone commits code which is not buildable and belongs to another team's project. But since bamboo tries to build entire solution, it also affects other teams CI.

Also will appreciate if you could refer related resources docos for this.

Thanks,


Answers:
author: Omar Herrera
body: Hi [@Ahmet Sertan Y?ld?r?m](/t5/user/viewprofilepage/user-id/1200973) please try with [bamboo inject variables](https://confluence.atlassian.com/bamboo/configuring-a-variables-task-687213475.html).

You can edit some file in your code, with the name of the project to build and inject into bamboo and make the build based in this injected variable.


Tags: build

continuous-delivery

visual-studio
bamboo build regex
Asked by Mike:

I want to kick off builds only after commits to certain filepaths. Seeing a lot of conflicting/mis-information on the nets. In particular, if I try \*\* I get an error saying invalid regex.

Lets say my repo is named "company/repo". And the filepath I want to allow for is "company/repo/commons". How can I write the regex that bamboo accepts it?

List of failed attempts:

\*commons\*

/\*\*/commons/\*\*/

commons/\*

commons\\/\*


Answers:
author: robhit
body: Hi Mike,

Thanks for your question!

Could you please try the below:

This will match what you are looking for:

```
.*/commons
```

The below will match the infinite:

```
/*.*
```

Thanks,

Robhit

comments: author: Mike
body: Hi Robhit-

I tried

```
.*/commons
```

and it doesnt work. Now what?

Mike


author: Mike
body: Also, what do you mean by:

The below will match the infinite:

```
/*.*
```
Can I substitute a variable for the host name in the bamboo SCP deployment task?
Asked by Nat Kershaw:

I am configuring a deployment project to copy an installation package to a server, then run the installation, then clean up, all of which require SCP and SSH tasks. Can I define a variable that I can insert for the Host field of these tasks e.g. ${target.server}


Answers:
author: Omar Herrera
body: Hi [@Nat Kershaw](/t5/user/viewprofilepage/user-id/569711) you can use variables in both task on the host field.

There is an example

Cheers

![Capture.JPG](https://community.atlassian.com/t5/image/serverpage/image-id/17768iDEEDD0E92CFB4FB1/image-size/large?v=v2&px=999 "Capture.JPG")

comments: author: Nat Kershaw
body: Great, thanks for that. It was the \`bamboo.\` that I was missing.


Tags: deployment

scp

ssh

variable
Triggers in bamboo environments
Asked by Nicolas Vila:

Hello,

I have a requirement to deploy a SCM with a specific requirement. When a developer pushes code to the repo, the SCM should start a build and deploy it to a development environment. If the developer is OK with the application, then he or she should be able to manually click on a button (or some other manual interaction) and then, the SCM should deploy that code to a QA server. The QA team will test the app, and if it's OK they will manually acknowledge the build and in turn the SCM will deploy to a third environment (and so on).

Is this scenario possible to achieve with bamboo (or maybe Jira+bamboo)? We are currently using both jira and bitbucket.

Thanks a lot!!


Answers:
author: Jobin Kuruvilla [Adaptavist]
body: This is where you can use deployment projects in Bamboo. You can define multiple environments and manually push the deploy button to promote a release from one environment to another.

Check out <https://confluence.atlassian.com/bamboo/deployment-projects-338363438.html> and related pages to see if it will help you.

comments: author: Nicolas Vila
body: Thanks Jobin!


Tags: environment

trigger
error migrating to new server
Asked by Joshua Bouganim:

Hello,

I am migrating our bamboo instance to a new server.

Old server: version 5.15.4 build 51517

New server: 5.15.5 build 51518

I followed the KB article and the new instance stops working after importing the backup of the old server

the logs show a cipher id error and i can see that there is no cipher folder under %bamboohome%/xml-data/configuration. i tried copying the cipher folder from the old server to the new server but that didnt solve anything

View log here:

<https://pastebin.com/WL6WRzTQ>


Answers:
author: Jeyanthan I
body: > I followed the KB article and the new instance stops working after importing the backup of the old server

Bamboo 5.15.x shipped with a new [System-wide encryption feature](https://confluence.atlassian.com/bamboo/system-wide-encryption-873930114.html). The encryption key is stored in the database and on the filesystem. Both the filesystem and the database key parts are required to perform successful decryption. The key part stored on your filesystem is located under *\<BAMBOO-HOME\>/xml-data/configuration/cipher*. It is essential to have both the parts available for Bamboo to work.

Like it is mentioned in this [KB article](https://confluence.atlassian.com/bamkb/unknown-cipher-data-id-0-when-performing-certain-actions-in-bamboo-on-windows-after-switching-bamboo-to-run-as-a-service-923437107.html), the below SQL statement in your bamboo database returns two rows:

```
SELECT * FROM BANDANA
WHERE BANDANA_KEY LIKE '%cipher%';
```

If it is not found, you may have to reinstall and use export and import option to do the migration.


Tags: jira-service-desk

migration