**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
Robin Shen commented 10 months ago
OneDev uses heredoc to do the job:
ssh user@server << EOF
ruby -v
EOF
Please test above command to see if it prints the same.
bufferUnderrun commented 10 months ago
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]
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 ?
Robin Shen commented 10 months ago
When calling ssh to execute remote commands (heredoc or other approaches), it has no way to set up environments included in .bashrc or .profile. You will need to set up them explicitly in commands.
bufferUnderrun commented 9 months ago
so i manually call source ~/.zshrc before all commands and it works.
thanks.
Maybe it should be written somewhere in documentation to source profil to avoid others facing same issue.
bufferUnderrunchanged state to 'Closed'9 months ago
Previous Value
Current Value
Open
Closed
Robin Shen commented 9 months ago
Yes, I will mention this in inline help of the step.
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