Broken Shell in Jenkins

28 views
Skip to first unread message

Ana MB

unread,
Sep 5, 2017, 4:13:56 AM9/5/17
to Jenkins Users
Hi guys!

I'm using Conditional Steps Plugin in Jenkins and I want to execute commands in the Shell, but it seems not to work. I show you my case: 

I try to execute a simply "ECHO HI WORLD", and the console returns the following:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 58.289 s
[INFO] Finished at: 2017-09-05T09:59:49+02:00
[INFO] Final Memory: 17M/56M
[INFO] ------------------------------------------------------------------------
[File exists] check if file exists [/Researches/PruebaMail/test-output/test_resultados_miniprueba.csv]
Run condition [File exists] preventing perform for step [Execute shell]
Finished: SUCCESS

And nothing happens, "HI WORLD" doesn't appear anywhere... why??

I'm turning crazy...

Thanks so much for your time... 

Ana MB

unread,
Sep 5, 2017, 5:45:43 AM9/5/17
to Jenkins Users
Ok.... the problem is with the "File exists" Condition, because I've put "Always" and I get the message "HI WORLD":

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 53.709 s
[INFO] Finished at: 2017-09-05T11:32:57+02:00
[INFO] Final Memory: 17M/56M
[INFO] ------------------------------------------------------------------------
Run condition [Always] enabling perform for step [Execute shell]
[workspace] $ /bin/sh -xe /tmp/jenkins4771372472076695799.sh
+ echo HI WORLD
HI WORLD
Finished: SUCCESS

What could be happening with this condition "File exists"?

Thanks so much!!!

Björn Pedersen

unread,
Sep 5, 2017, 6:35:27 AM9/5/17
to Jenkins Users
Hi,

File exists does not seem to do  ant-style expansion, if I look  at the docs. Either specify the correct relative path, or use Files Match.

Björn

Ana MB

unread,
Sep 5, 2017, 7:01:45 AM9/5/17
to Jenkins Users
I've tried with "Boolean" Condition and it's not working yet... I don't know if the token is right:


It returns this console output:


[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 54.479 s
[INFO] Finished at: 2017-09-05T12:57:09+02:00
[INFO] Final Memory: 16M/56M
[INFO] ------------------------------------------------------------------------
Exception caught evaluating condition: [org.jenkinsci.plugins.tokenmacro.MacroEvaluationException: Unrecognized macro 'test_resultados_miniprueba' in '$test_resultados_miniprueba'], action = [Don't run]
Finished: SUCCESS


What is the error in the condition token?

Thanks so much for your time!!!!

Ana MB

unread,
Sep 5, 2017, 7:09:06 AM9/5/17
to Jenkins Users
This topic can be closed. 
I open a new one with the real problem.


El martes, 5 de septiembre de 2017, 10:13:56 (UTC+2), Ana MB escribió:
Reply all
Reply to author
Forward
0 new messages