Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins console output has these strange characters from grunt command [31m[[39m...

I'm running a grunt-contrib-jshint command using jenkins and the console output is contains text like:

[31m[[39m[33mL425[39m[31m:[39m[33mC29[39m[31m][39m [33mExpected a conditional expression and instead saw an assignment.[39m

Any ideas why? and how to fix it.

Running the same script directly displays:

[L425:C29] Expected a conditional expression and instead saw an assignment.

I've checked the file.encoding setting which was set to MacRoman and after setting export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8 is now UTF-8.

like image 205
James Da Costa Avatar asked Feb 28 '13 21:02

James Da Costa


People also ask

Does Jenkins provide console output?

View the console output:From the Jenkins dashboard, click the job link name from the table. Click the build number in the Build History table in the sidebar. If you need to send the console output to Perforce Support, send it as plain text. Click View as plain text in the sidebar menu.

Where is Jenkins console output stored?

Log files should be at /var/log/jenkins/jenkins.


2 Answers

Those look like color escape sequences. See if you can pass a parameter like --no-color to the command (if the tool supports it, see this maybe), or look at the AnsiColor plugin

like image 99
Larry Shatzer Avatar answered Oct 04 '22 20:10

Larry Shatzer


Alternatively, if you like colors, you can use the Jenkins AnsiColor Plugin to properly display the color escape sequences in the build log.

like image 7
Daniel Avatar answered Oct 04 '22 20:10

Daniel