youngmon/atlassian-qna huggingface dataset:
how to run bash script with args (builder created)
Asked by nikita tovstoles:

In one task, I need to execute a BASH script like so:

```
workingDir> ./deploy-webapp.sh -p staging
```

I:

1. created an "Executable" pointing to /bin/bash
2. created a 'command' task, using above executable
3. specified "./deploy-webapp.sh -p staging" as Argument
4. set working dir to $workingDir

yet running the build I get:
>
> |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------|
> | ... running command line: /bin/bash deploy-webapp.sh -p staging ... in: /opt/clabs/bamboo-home/xml-data/build-dir/ECR-CLP774-JOB1/deploy ... using extra environment variables: TMP=/tmp TEMP=/tmp |
> | 21-Feb-2012 20:13:10                                                                                                                                                                               | /bin/bash: deploy-webapp.sh -p staging: No such file or directory |

trimming Argument field to just "./deploy-webapp.sh" works, but I do need to pass that option. What am I missing?

I am using 3.4.3 build 2811

Thanks


Answers:
author: James Dumay
body: I just tried the same thing here and it worked. Could you screenshot your Command Task configuration and repost it here for me to take a look?


author: Sam Kenny
body: I could never get this work. I am running Bamboo 5.12.3.1.

Using the example above:

. deploy-webapp.sh -p staging

staging was ignored. If I created an environment variable (e.g. STAGE_NAME=staging) and referenced $STAGE_NAME in the script it worked fine. But I could never get staging to be passed in. I tried passing it using the arguments field - both with and without quotes - but still no joy.

In the end I wrapped the commands I was calling in a python script and it worked as expected. i.e.

```
python deploy-webapp.py -p staging
```


author: Colin Goudie
body: Just to answer this, I think Bamboo's description field for arguments is confusing.

If you are passing args to bash etc.. and they are separate arguments then you DONT need to enclose them in quotes in the textfield. At least that is what I have found


Tags: bash
Run a task before a bamboo build
Asked by Kepio:

Is there a way to run a task before a bamboo build OR run the task and if it fails not increment the bamboo build number ( so that the package version does not get incremented?)


Answers:
author: bmccoy
body: Hi,

What sorts of things are you looking to do inside this task?

We do have a plugin point which allows you to intercept whether a build should run or not, you might be able to use this to extend Bamboo to meet your needs. But it really depends what you are trying to achieve. <https://developer.atlassian.com/display/BAMBOODEV/Build+Trigger+Condition+Module>

Cheers,

Brydie

comments: author: Kepio
body: I want to check if the package about to be built in the plan (packages get named with a prefix + build number) already exists ( it would be the case if someone created it manually) - so it's basically checking if a file exists and it can be run on the bamboo server.


author: bmccoy
body: By the sounds of things the plugin point could work for you, seeing as though the check can be run on the server.
Some questions about the setup in the cloud
Asked by Filip Traugott:

Whose cloud are you using, is it Amazon, Google, Microsoft, etc.?

How is security in the cloud guarantied?

How has the cloud provider built up its security?

Where are the servers physically?


Answers:
author: NikE
body: For an OnDemand instance, this link should cover all of the details (note that the browser specs need to be updated to more recent releases):

[https://www.atlassian.com/hosted/security](/questions/20069/jira-ondemand-jira-gantt-chart-project)

The only other 'cloud' involved is if you use Bamboo, which uses Amazon's EC2 (Bamboo, itself, is hosted the same as all other apps and the above doc applies to it).


Tags: cloud

integration
Is it possible to tag a Bamboo build only if a particular variable is set?
Asked by charlesgutjahr-ourcommunity:

The "VCS Tagging" task works great at tagging our Subversion repository with a custom variable --- but only when we remember to fill in that custom variable. Is there any way to configure the VCS Tagging task (or a job that contains it) so that it only runs if a tag name has actually been specified?

To be specific, we've set up a plan in Bamboo with a custom variable called *ReleaseVersion*. Its default value is blank. Then one of the jobs in the plan has a VCS Tagging task with the tag name:
> ${bamboo.ReleaseVersion}

If we run the plan by chosing *Run Customised...* and specify a value for *ReleaseVersion* then it tags everything correctly with the value we set. However if we just run the default plan it fails because nothing has been set in *ReleaseVersion* --- unsurprisingly we get this exception:
> Error occurred while running Task 'Tag Subversion(1)'. This build will fail. Caused by:
> > com.atlassian.bamboo.task.TaskException: Exception when tagging repository
> > ...
> > Caused by: org.tmatesoft.svn.core.SVNException: svn: Path 'svn://repository.local/SG/tags' already exists

Basically it's trying to apply an empty string as a tag.

Is there any way to configure Bamboo to skip the task --- or the job --- if the tag or variable is empty?  
We don't want to tag every build, so we don't want to specify the variable every time!


Answers:
author: Przemek Bruski
body: In your case, it's best to create a script task that will tag or not depending on the variable content.

comments: author: charlesgutjahr-ourcommunity
body: Good to know that it's not possible with the internal VCS Tagging task.

It does sound to me like a useful feature to add in a future release, though!


author: Matthew J. Dovey
body: I agree that it would be a useful feature - I've created a jira request for a slightly more generalised feature

<https://jira.atlassian.com/browse/BAM-11257>


author: Matthew J. Dovey
body: It would be a useful feature if any task could be run conditionally on the value or existence of the variable, including the VCS tagging task.

I've made a feature request here for this: <https://jira.atlassian.com/browse/BAM-11257>


Tags: bitbucket

tag
Configure environment for testing on Bamboo
Asked by Guillaume Lucazeau:

Hello,

I got to test plans running on Bamboo 3.4.2, running on Linux Debian.

One is executing basic JUnit tests, the other is executing Selenium tests.

With the Selenium test plan, the Selenium server complains that it can not launch the browser.

I looked on the internet and found that I needed to set the DISPLAY environment variable. So I did it, in the .bash_profile of the bamboo user, I put

export DISPLAY=:1

But after that, I think it broke the JUnit plan, now I get this error:

java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment

Internet again, I see that i have to use the headless mode of Java, so again in the .bash_profile I put:

ANT_OPTS="-Djava.awt.headless=true"

But my plans are still broken, with the same errors. Is it the right way to configure the environment for Bamboo? We had the same plan on another server and I didn't see any particular configuration (these two environment variables are empty)

Any hint would be greatly appreciated because I'm kind of stuck now. Feel free to ask if you need more details.

Thank you!

Guillaume


Answers:
author: Przemek Bruski
body: Try setting the ANT_OPTS only for the JUnit plan, remove that setting from user profile.

comments: author: Guillaume Lucazeau
body: Hello Pzemek, thank you for your answer.

I removed every environment variabels from the user profile and set some in the plan but it didn't change anything. But I saw this error that I missed before:

17-Feb-2012 17:08:00 \[FATAL ERROR\] com.atlassian.maven.plugin.clover.CloverReportMojo#execute() caused a linkage error (java.lang.NoClassDefFoundError) and may be out-of-date. Check the realms:  
17-Feb-2012 17:08:00 \[FATAL ERROR\] Plugin realm = app0.child-container\[com.atlassian.maven.plugins:maven-clover2-plugin:2.6.3\]

So I'm going to update the plugin, but I'm not sure if you can use the 3.x version of the plugin with Maven 2


author: Guillaume Lucazeau
body: Seems like upgrading the Clover plugin was the key, but thanks for your answer I didn't know you could have environment variables at general and plan levels

Cheers,

Guillaume


Tags: selenium
OnDemand Bamboo version upgrade
Asked by David Japaridze:

Currently OnDemand Bamboo version is 3.0.4. Do you plan to upgrade to latest Bamboo version 3.4 in nearest future?


Answers:
author: Shawn Johnson
body: It is early April, where is the upgrade progress?


author: Michael Knight
body: We'll probably be skipping to the next version after 3.4 in late March/early April.

comments: author: David Japaridze
body: Upgrade process is delayed? If it's so, please inform when upgrade is planed


author: Michael Knight
body: Bamboo 4 integration is currently being worked on. It will still be a number of weeks yet.


author: Bastiaan Jansen
body: Hi David,  

There was indeed some delay in the implementation for this upgrade. We now have a page wich will keep you updated about the releases. <https://confluence.atlassian.com/display/AOD/Atlassian+OnDemand+release+summary>Bamboo 4.1 is plannend to be implemented early July, it should not take long anymore.

comments: author: David Japaridze
body: Thanks Bastiaan for information. Hope you'll deliver 4.1 as planned


author: David Japaridze
body: We are waiting for Bamboo upgrade from February. Could you tell us when new version will available? At least this year or next year?!


author: Simon_Maddox
body: "a number of weeks" have passed... is there an ETA for Bamboo 4 yet?

comments: author: James Dumay
body: Its being actively worked on now, we cant commit to a firm date just yet.


author: Simon_Maddox
body: Thanks, James. We're hitting brick walls with Selenium testing on V3 so are tempted to move to another solution. It would be helpful to get an approximate feel for the timescale, even if it changed. I'm looking for order of magnitude rather than firm date.


Tags: cloud

jira-service-desk
How to retrieve images (gif) from within the plugin jar file
Asked by Akira Tsuchiya:

I want to display images contained in the plugin jar file.

I refered to the online doc below.

<https://developer.atlassian.com/display/BAMBOODEV/Downloadable+Plugin+Resources>

1. The directory of 'testimages' is created in the plugin jar file. And under the directory, AAA.gif resides.

testimages/AAA.gif

2. The line below is added in the atlassian-plugin.xml.

\<resource type="download" name="testimages/" location="testimages/"/\>

3. In the relevant ftl file, the line is added.

\<img src="testimages/AAA.gif"\>

4. The image is not displayed.

Where did I make a mistake?


Answers:
author: Andy Brook [Plugin People]
body: Did you include {\<tt\>server root}/download/resources/{plugin key}:{module key}/testimages?\</tt\>

comments: author: Akira Tsuchiya
body: Thank you.

It worked.
Is there a way to make links in the build logs 'active' in the bamboo 'Build Log' page?
Asked by Ben Kunkel:

We often embed links to documentation in our error output and these links eventually wind up in our build logs. I'd like users to be able to click on these links directly from the build log in Bamboo rather than having to copy \& past into the address bar.


Answers:
author: Przemek Bruski
body: You can't do it without a plugin or modification of Bamboo sources. Modification of source would be very easy:

1. change com.atlassian.bamboo.build.SimpleLogEntry#getLog to "return log;"
2. if your logs are longer than 1000 lines, you have to up the limit in com.atlassian.bamboo.build.ViewBuildLogs.java.

Security notice:

Allowing HTML in log output can lead to XSS attacks against your instance, so do it only if you have an internal instance or al willing to play with com.atlassian.bamboo.util.BambooStringUtils#encodeHtmlWithTagWhiteList to escape the output (the method wasn't meant for processing large amounts of data, so you'd need to make sure it's run only when really needed.)
On Repository Naming Rule in Bamboo 3.4.x
Asked by Akira Tsuchiya:

I want to discern multiple repositories in a Plan.

A ResultsSummary has multiple List\<RepositoryChangeset\> accordingly to the repositories in a Plan.

To know which RepositoryChangeset is related to which repository, I guess repositoryChangeset.getRepositoryDefinition().getName() is the only way.

It returns like 'Subversion Web', 'Subversion Repository' and so on.

When the repository is Subversion, the repository name becomes 'Subversion' + ' ' + '\[Repository Root Path Name with the first letter upper-cased\]'.

Is this right?


Answers:
author: Przemek Bruski
body: Hmm, how about RepositoryChangeset.getRepositoryDefinition().getId() and use it to get the repository using

PlanHeleper.getRepositoryDefinitionMap() ? You'll get a RepoDef and you can call getRepository on it.


author: Przemek Bruski
body: The repositories can be renamed, so you shouldn't rely on naming. If you want to identify a repository, you should use getId instead of getName.

comments: author: Akira Tsuchiya
body: Sorry for my some misunderstandins.

I want to know which RepositoryChangeset obtained by ResultsSummary#getRepositoryChangesets()

is related to which Repository obtained by PlanHelper.getRepositories(getPlan()).

The repositoryChangeset.getRepositoryDefinition().getId() is good, but on the other hand SvnRepository seems not to have getId().
Agents getting countless "connection refused" errors before they can connect to Bamboo. Any idea?
Asked by Elvir Hadzic:

So, when I start up an Agent I can see the "A remote agent is loading in..." message. But the agent (nearly) always gets the "java.net.ConnectException: Connection refused: connect" error and has to retry. The funny thing is, it will connect eventually. But sometimes it takes 10 minutes before the agent manages to register itself to Bamboo and at other times it takes up to one hour or even more!

I know this never was a problem earlier on but I don't know what version of Bamboo we were running back then or if it has anything to do with the problem at all. We're running 3.4.3 now and I installed the newest agents. What's really startling me is that it works eventually. It would be another thing if it just couldn't connect at all. Then, I'd suspect the network to be the culprit. But at this point I really don't think so.

Here is what I've done allready:

* Installed the newest agents: no change
* First enabled the clients on Bamboo and then deactivated remote authentication completely just to be sure.
* Checked the firewall rules between the different subnets: no problems there
* Moved the agent machine into the same subnet as the bambooserver: no change
* Deactivated the firewalls on the agent and bamboo server completly: even though they're in the same subnet now and no firewalls are activated at all; still got the "connection refused" .
* Ping from client to bamboo and vice versa works
* My next and last idea was a DNS problem. That could also explain why the connection sometimes works and sometimes it doesn't. So, I reinstalled the agents but used the IP instead of the URL which should rule out DNS problems

After all this the problem still exists and I'm running out of ideas.

Sure hope anyone of you has any suggestions. I'd be really appreciated!


Answers:
author: Elvir Hadzic
body: It seems to have been a DNS problem after all. I used the IP on the Agent servers but I also had to set it in the bamboo.cfg.xml file on the bamboo server. The bamboo.jms.broker.client.uri, to be precise. Just in case anyone else encounters this problem.

comments: author: Mark McD
body: I had a similar problem. It looks like Bamboo sends the broker URL to the agent \& it was sending it's local hostname, which isn't the same as the external hostname the agent needed to use. I've updated bamboo.cfg.xml \& the Bamboo server hostname so it's all good. Thanks for the tip!


Tags: error

remote-agent
On Bamboo 3.4 [chain.subMenu/chain] behavior
Asked by Akira Tsuchiya:

I just want to confirm about the \[chain.subMenu/chain\] specification in Bamboo 3.4.x.

I added a new plan sub menu.

And when the tab is clicked, Bread Crumb, Plan Navigator, and so on are displayed on the screen.

But when the URL is directly loaded, Bread Crumb, Plan Navigator, and so on are not displayed.

Is this the specification?

When it is Bamboo 3.2, Bread Crumb, Plan Navigator, and so on are not displayed even when the tab is clicked.

![](../../upfiles/1_1.PNG)

![](../../upfiles/2_1.PNG)


Answers:
author: bmccoy
body: Hi,

This is the desired behaviour. The idea is that it should be as easy as possible for plugins to get the same look and feel for their pages as the rest of Bamboo. We have made some improvements in the last couple of releases to help with this.

There are two ways that Bamboo decides what html to decorate your page with. The first is based on the url. We pattern match the url to determine where in the UI your page is sitting and decorate accordingly. The other is what Przemek is talking about above. If Bamboo gets it wrong or can't figure it out, you can mandate which decorator to use.

You can find more information about decorating your pages here:

<https://developer.atlassian.com/display/BAMBOODEV/XWork+Plugin+Module#XWorkPluginModule-UsingBamboo%27sDecorators>

ftl is Freemarker (.ftl is the file extention used for freemarker files). It is the templating language that Bamboo uses for creating our html pages. It is similar to jsp or velocity (if you have heard of those...)

You can find specific information about freemarker here:

<http://freemarker.sourceforge.net/docs/index.html>

Cheers,

Brydie


author: Przemek Bruski
body: Do you have meta tag in your ftl for that tab?

comments: author: Akira Tsuchiya
body: No, I do not know deeply about ftl technology.

What meta tag should I put in the ftl tag?

I have been wondering what FTL stands for and where I can find the technical material for that.

I have always looked into the directory of /webapp for FTL study.

On the online Development Hub, I do not find any descriptions about FTL.

Maybe I overlooked relevant pages.


author: Akira Tsuchiya
body: Thank you for your info.

With the appropriate meta tag, it worked.
How to make the clearcase plugin for Bamboo work?
Asked by Sean HE:

I just used the clearcase plugin : clearcase-bamboo-0.5.0.jar on Bamboo2.7. (the later version of Bamboo seems not support clearcase plugin). The Bamboo is installed on Windows2003.

And then I just create a plan for a build task. Our clearcase system is working on Clearcase7.1.x.

Use clearcase /Base mode.

Here is the build exception:

INFO \| jvm 1 \| 2012/02/15 22:29:44 \| 2012-02-15 22:29:44,116 ERROR \[29549213@qtp-8785225-18\] \[ExecTask\] Execute failed: java.io.IOException: Cannot run program "cleartool" (in directory "D:\\view\\uepmain_supbird1"): CreateProcess error=2, The system cannot find the file specified

INFO \| jvm 1 \| 2012/02/15 22:29:44 \| 2012-02-15 22:29:44,116 ERROR \[29549213@qtp-8785225-18\] \[ManualBuildDetectionAction\] Error encountered while triggering manual build: null

INFO \| jvm 1 \| 2012/02/15 22:29:44 \| java.lang.NumberFormatException: null

In fact, we don't have any tool called "cleartool" of command line. We juse have a tool "rcleartool.bat".

Has anyone met the similar issue?

Thanks in advance.

The document of this plugin is not enough for a newbie to get it work.


Answers:
author: Przemek Bruski
body: Unless someone is able to provide better information:

It's been a long time since I've used ClearCase - if I remember correctly, rcleartool is a remote client with limited capabilties (snapshot views only?), while cleartool is a part of a full-blown CC installation (dynamic or snapshot views are supported). Maybe IBM provides only RC now or maybe you need to install the non remote client.

Alternatively, you could try modifying the plugin (it is open source) to support RC client. Working on Atlassian plugins is pretty easy, especially if you already have a working base.

comments: author: y s
body: does the plugin open source support later version of bamboo?


Tags: clearcase
Are you considering opening JIRA on demand with custom bamboo?
Asked by Michael McFarland:

We love the SAS model, but we use Rackspace cloud. We want to be able to integrate JIRA OnDemand with custom Bamboo agents. I realize this doesn't exist today, but is this something that you are considering and if so, what is the timeframe?


Answers:
author: Michael Knight
body: Hi Michael,

This feature is being considered but we do not have a a plan or timeline for it at this stage. We have the feature request for this [here](https://studio.atlassian.com/browse/JST-3425), which you can keep a watch on it.


Tags: cloud

jira-cloud
Running selenium test cases after every commit into repository
Asked by Laks:

How should i configure Bamboo to run test selenium test cases after every change made to the SVN repository??


Answers:
author: Adam Myatt
body: I would configure the plan to poll the repository, however you do not necessarily want to run all your tests for every commit. In many cases you want to poll your repository for changes, but have a delay or quiet period - which I believe is a setting in the SCM tab in most newer versions of Bamboo.

If you're building a Java app, you can write your Selenium tests as JUnit tests. Bamboo can then execute them normally as JUnit tests and graph the results just like JUnit tests.

comments: author: Laks
body: Thanks Adam... As you said i can run my selenium test cases as Junit tests. I would like to know if there are any documents that will help me set up Bamboo with my Junit test cases. Currently all my JUnit test cases are checked-in into a SVN repository. I am evaluating Bamboo for my organisation.


author: Adam Myatt
body: If you are using Junit via Ant targets, see <http://confluence.atlassian.com/display/BAMBOO/Ant>

... specifically section 6.

Additionally, see Parsing JUnit Tests in Bamboo : <http://confluence.atlassian.com/display/BAMBOO/JUnit+parsing+in+Bamboo>

comments: author: Laks
body: Thanks again... I am reading through the link that you have provided. what do you think is the main difference between Bamboo and Hudson or even Jenkins.


author: Joe Clark
body: Hey Rajul - That's an interesting question - you should ask it as a new question though, so it is searchable and will allow other users to find the answers, and avoids cluttering up this question.


author: Laks
body: I have added it as a new question. I would also like to know how i should configure bamboo to run a test suite.
how to parse django tests with bamboo
Asked by nseinlet:

I'm running bamboo with a python django project. The builds fails or is succesful if the python manage.py test myproject fails or is succesful.

But bamboo always report 0 tests, even if 400 tests are runned.

How do you use bamboo with django projects?


Answers:
author: Przemek Bruski
body: I've never done it, but you should be able to hook up this library;

<http://pypi.python.org/pypi/unittest-xml-reporting/1.0.3>

And then configure Bamboo to parse Unit Tests XML reports.

comments: author: Aaron Cohen
body: New to Bamboo here. I have a similar need I think. I have tests running in unittest/nose and want Bamboo to parse the results. How do I:

"configure Bamboo to parse Unit Tests XML reports."?

When adding a test task, I see nothing of the sort. Should I just add the Junit task?


author: Mike Ellertson
body: I too am attempting to run Django tests (using the nose test runner). Do you have a step-by-step to get this working?