dos2unix in Jenkins

937 views
Skip to first unread message

El alaoui Mohamed Reda

unread,
Dec 19, 2012, 3:19:40 PM12/19/12
to jenkins...@googlegroups.com

Hello


i have a Jenkins installed in Windows and i have a project where i have a lot of script file .sh i 

so must do dos2unix in commande Ligne for all the file to convert for windows forme to unix forme

i ask you if i can have a plugin or a windows script to convert all file in the Build Time

thanks

El alaoui Mohamed Reda

unread,
Dec 20, 2012, 2:34:03 PM12/20/12
to jenkins...@googlegroups.com
No response ? 

2012/12/19 El alaoui Mohamed Reda <infore...@gmail.com>



--

Mohamed Reda, El alaoui


344.gif

domi

unread,
Dec 22, 2012, 6:01:57 AM12/22/12
to jenkins...@googlegroups.com
you could use ANT with the fixCRLF task: http://ant.apache.org/manual/Tasks/fixcrlf.html

<fixcrlf srcdir="${src}" includes="**/*.sh"
         eol="lf" eof="remove" />
/Domi


On 20.12.2012, at 20:34, El alaoui Mohamed Reda <infore...@gmail.com> wrote:

No response ? <344.gif><344.gif><344.gif><344.gif>

El alaoui Mohamed Reda

unread,
Dec 25, 2012, 6:38:03 AM12/25/12
to jenkins...@googlegroups.com
thanks Tomi :)

2012/12/22 domi <do...@fortysix.ch>

Brent Atkinson

unread,
Dec 25, 2012, 11:55:48 AM12/25/12
to jenkins...@googlegroups.com

Are you using subversion to checkout the project? If so, you might just consider setting the svn:eol property on those files to 'LF' so they always have Unix line endings on checkout.

El alaoui Mohamed Reda

unread,
Dec 25, 2012, 3:32:13 PM12/25/12
to jenkins...@googlegroups.com
i'm using subversion but i don't understand how i can make it in jenkins please !!

can you explain me !!!


2012/12/25 Brent Atkinson <brent.a...@gmail.com>
roperty

Brent Atkinson

unread,
Dec 25, 2012, 6:28:44 PM12/25/12
to jenkins...@googlegroups.com
Hi,

It should be simply a matter of doing the following:

  • Checkout your working copy
  • Change to your working copy directory
  • Find all the files named *.sh and set the svn property 'svn:eol-style' to the value of 'LF'
This tells subversion to convert the line endings of the file to contain only linefeeds upon checkout, regardless of the type of system it is checked out to. Because scripts are for linux/unix anyway this setting is appropriate. On linux/unix using the command line client the above steps look something like the following:

# Checkout the working copy
svn co https://hostname.domain/path/to/repo/ my-project

# Change to the working copy directory
cd my-project

# Find all .sh files and set the line ending style to linefeed only
find . -type f -name '*.jsp' | xargs svn propset svn:eol-style LF

If you're not using the command line you can just google for 'setting svn:eol-style <tool-of-choice>' and use the instructions to set the property to 'LF' for linux/unix files.

Good luck,

Brent

El alaoui Mohamed Reda

unread,
Dec 27, 2012, 5:07:54 PM12/27/12
to jenkins...@googlegroups.com
it's okey thank you  very much :)

2012/12/26 Brent Atkinson <brent.a...@gmail.com>

Hi,

It should be simply a matter of doing the following:

  • Checkout your working copy
  • Change to your working copy directory
  • Find all the files named *.sh and set the svn property 'svn:eol-style' to the value of 'LF'
This tells subversion to convert the line endings of the file to contain only linefeeds upon checkout, regardless of the type of system it is checked out to. Because scripts are for linux/unix anyway this setting is appropriate. On linux/unix using the command line client the above steps look something like the following:

# Checkout the working copy
svn co https://hostname.domain/path/to/repo/ my-project

# Change to the working copy directory
cd my-project

# Find all .sh files and set the line ending style to linefeed only
find . -type f -name '*.jsp' | xargs svn propset svn:eol-style LF

If you're not using the command line you can just google for 'setting svn:eol-style <tool-of-choice>' and use the instructions to set the property to 'LF' for linux/unix files.

Good luck,

Brent Atkinson

unread,
Dec 27, 2012, 5:23:52 PM12/27/12
to jenkins...@googlegroups.com

Happy to hear you were able to solve your problem.

Reply all
Reply to author
Forward
0 new messages