Forced line endings on Bamboo Agent?

Hi,

I've only recently started using Bamboo along with Bitbucket,  we have a scenario (however wrong it might be) that files need to be downloaded and run by the Bamboo agent on a Linux machine, but with CRLF endings.

I can't seem to get this to happen.

I've managed to change all the line endings in the files, and also create a .gitattributes file trying various options, but the files in question always end up downloading with a the linefeed (/n) only.

Is there a setting that can be placed within the bamboo agent to say how it should handle the files?  Does the gitattributes file only suggest how the file should be edited when changed, so it won't help when cloning the repo for tests?

 

Any ideas would be welcomed.

Thanks,

Adam.

4 answers

If you are creating these files on Windows, check that you don't have core.autocrlf set to true. This setting changes text files from Windows to Linux line-endings during push and changes them back during pull.

https://git-scm.com/book/tr/v2/Customizing-Git-Git-Configuration

-Rich

Thank you, though I have checked that.  I realised the core.autocrlf entry wasn't actually set, so I set it to false just in case.

I then realised that the original upload of files may have previously been converted to whatever the default setting is.  So as an experiment, I recreated the repository (this is in the setup stage, so no one else is working on this data yet).  I created a .gitattributes file with

*    text eol=crlf

in it, and made sure everything was uploaded like this.

I cleared everything where the agent runs, so it's git repository was cloned afresh, but the same occurred, the files are still downloading with /n only.

I can't help but think I am missing something obvious here.

0 vote

Are you using native git (I mean do you have git capability defined in Bamboo)?

Thanks for this, you may be right.  I don't believe we are using native git, so could the built-in version not fully support this?  I can't get Git onto that machine for the moment, but I will see what I can do and if it makes a difference.  This at least makes more sense.  Thanks.

I know it has been a long time, but I finally got Git onto the machine.  I have no idea how to check if it is working though.
I added a line to the bamboo-capabilities.properties file...

system.git.executable=/usr/bin/git

I have no idea if that is correct.  I see what seems like hundreds of pages saying that you need native git, but none to say what that actually entails.

Also, this is a remote agent, I have no access to setting capabilities on the Bamboo server.

 

Anyway, if you haven't guessed, this hasn't changed what is happening.  Any more ideas?

 

Just to reiterate what we are doing - I upload files from a Windows machine, they are then downloaded onto the Agent which is Linux

Suggest an answer

Log in or Join to answer
Community showcase
Renan Battaglin
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,087 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot