Hello,
I am a new Jenkins user currently trying to setup jobs, and I am facing two issues which I hope this group can help me resolve.
My Jenkins runs on a web server that connects to a slave builder via ssh.
The configuration has "/bin/bash" as shell executable.
Issue 1: Alias are not supported in Jenkins shell scripts (?)
Example
Jenkins shell:
alias myCommand='source myCommandScript.sh'
myCommand -p option
Job console output:
alias 'myCommand=source myCommandScript.sh'
myCommand: command not found
Note the location of the quote changes in the output... pointing to a parsing issue.
I have tried to place this alias in a file, which I source from the Jenkins shell, but the result is the same, myCommand is not found.
Any clue how to get this to work?
Issue 2: "make" targets using "%" syntax are not supported (?)
My build system has several nested makefiles, one of them defining a generic rule for files with defined prefix and suffix.
Example:
...
myMake%Target.c: ...
...
This syntax should match any target that starts with "myMake" and ends with "Target.c" (e.g. "myMakeAnyStuffTarget.c").
This works fine from a console shell, but not from Jenkins...
Would someone be able to comment on any of these problems?
Thanks in advance for your help.
Regards,
remp12
To debug your make problem, please find the place in the build step where you call make and before that line insert the following two lines:
env
which make
Jenkins does not affect the behavior of make in any way. Probably the environment of Jenkins is different and Jenkins is just executing a different make than you are from the command line. Usually this happens because Jenkins is running as a different user with different environment and/or Jenkins is running in a non-interactive shell, which could behave differently from an interactive shell. To find the exact way they differ, you should consult the manual of your shell.
-- Sami