-
OneDev uses heredoc to do the job:
ssh user@server << EOF ruby -v EOFPlease test above command to see if it prints the same.
-
i confirm the difference come from heredoc
with heredoc, incorrect
ssh user@server << EOF heredoc> ruby -v heredoc> EOF Pseudo-terminal will not be allocated because stdin is not a terminal. ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.x86_64-darwin22]without heredoc, correct
ssh user@server ~ % ruby -v ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-darwin22]As i test my command inside ssh (works) and then copy/paste into onedev ssh step (do not work then), that's why i break my CI/CD.
Do you have any workaround for heredoc having the same behaviour as inside an ssh ?
-
When calling ssh to execute remote commands (heredoc or other approaches), it has no way to set up environments included in
.bashrcor.profile. You will need to set up them explicitly in commands. -
so i manually call
source ~/.zshrcbefore all commands and it works.thanks.
Maybe it should be written somewhere in documentation to source profil to avoid others facing same issue.
-
Previous Value Current Value Open
Closed
-
Yes, I will mention this in inline help of the step.
| Type |
Bug
|
| Priority |
Normal
|
| Assignee | |
| Affected Versions |
8.5.9, 8.5.2
|
Hi,
There is something strange when using the SSH step. The environment is not the same as connecting to ssh the classic way.
classic way, it's OK
using OneDev step, it's WRONG
classic way inside 1dev/ssh-client image, it's OK
**Question ** : how do you connect to ssh inside the command step ? and why i've got a different environment between classic manual ssh and onedev ssh step.
Thanks for your help