Search code examples
linuxbashsshcodeship

Codeship ssh commands


According to the documentation (https://codeship.com/documentation/continuous-deployment/deployment-with-ftp-sftp-scp/#run-commands-on-a-remote-server-via-ssh), you need to run all commands as a single command.

While I understand that, I don't understand how I can run the following as a single command, the process would be:

  1. ssh demo@111.1.111.101
  2. ssh user@test-server
  3. cd deploy
  4. ./deploy.sh

Not that the second command is run on 111.1.111.101 as demo

This is currently what I've tried:

ssh demo@111.1.111.101 "ssh user@test-server; cd deploy; ./deploy.sh"

But this seems to get stuck after the first ssh command, it never goes to the second ssh.


Solution

  • ssh -t demo@111.1.111.101 'ssh user@test-server "cd deploy; ./deploy.sh"'