-
Notifications
You must be signed in to change notification settings - Fork 49
##Frequently Asked Questions##
- When I deploy, the PATH environment variable on the server doesn't have all the normal directories I'd expect. Whatup?
Whiskey Disk executes deployments by issuing a single ssh command to be executed on the specified deployment target. By taking advantage of the ssh user@host '<command>'
syntax, WD only needs one ssh connection and concatenates all the remote commands to be executed in one ssh command. This is far more efficient than opening many ssh connections.
Depending on how the remote system is configured, this may cause issues with loading the login user's environment, affecting critical variables such as $PATH. The "problem" is explain concisely in the ssh man pages:
If command is specified, it is executed on the remote host instead of a login shell.
However, ssh will execute the file located at ~/.ssh/environment
when using the "single-command" syntax. So all you need to do is source your ~/.bashrc file from ~/.ssh/environment:
# ~/.ssh/environment
source ~/.bashrc
Please note that the use of ~/.bashrc
and not ~/.bash_profile
is significant here. Since ssh, as called by WD, is not allocating a tty on the remote host, ~/.bashrc
will be run instead of ~/.bash_profile
. A future release of WD will probably support passing the -t
argument to ssh, which forces a tty to be used and causing ~/.bash_profile
to be run (note that this may cause complications if the ~/.bash_profile
takes advantage of tty capabilities).
It doesn't seem to work : I get "Bad line 1 in /home/whoever/.ssh/environment" with OpenSSH_6.0p1, OpenSSL 1.0.1c 10 May 2012. I think you can only set environment variables in this file.