Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Forced line endings on Bamboo Agent?

Adam Green October 26, 2016

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

0 votes
Adam Green February 16, 2017

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

0 votes
Adam Green November 1, 2016

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.

0 votes
Krystian Brazulewicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 27, 2016

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

0 votes
Rich Duncan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 26, 2016

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

Adam Green October 26, 2016

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events