2

I have windows apps with XML text files that I edit on windows and check into GitHub. The files have correct Windows EOL formatting on my dev machine. Then I feed it through a Concourse CI pipeline using the Git resource and a windows worker to build an MSI. When I install the MSI on a Windows machine the XML text files have Linux EOL formatting.

What is the best way to fix this? If I understand Concourse correctly the Git resource is a docker container running on Linux so I can see why the files would get checked with Unix EOL formatting but I don't understand why it doesn't get converted to Windows formatting when the container is made available to the windows task.

Update: Slightly more complicated I have some steps that run on the Linux worker so the files need to have Linux EOL formatting when being used on the Linux worker. Example... pull a repos and pass it off to a job running on Linux to do a bunch of npm | grunt | bower type stuff then shuttle the files over to a Windows worker to build some ASP.NET Web API projects and use the Linux output as the Web UI and package it all up into an MSI.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100

1 Answers1

0

One better way to ensure eol keep consistent is to manage them through .gitattributes core.eol rules

That will avoid the effect of global configurations (applying to all repos) like

git config core.autocrlf

If true, that global rule (possibly active on ConcourseCI) would change eol automatically.
But a .gitattribute can be added to your repo, and will have precedence. That will ensure consistency.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I finally found time to look at this today. I don't have access to make a global change. I'd like to not have to have custom .gitattributes in hundreds of repos. I notice that .XML files EOL is being handled correctly by default. .CONFIG (also XML) are not. I'm wondering if there is something in Concourse that understands to update the EOL on XML files when moving the files to a Windows Worker but it doesn't know to do it to .CONFIG files. – Christopher Painter Oct 09 '17 at 13:11
  • @ChristopherPainter Note: you can have a global gitattributes files, for all repos: https://stackoverflow.com/a/28027656/6309 – VonC Oct 09 '17 at 13:36