Travis CI fails to rsync (ssh) with publickey, but same command works in terminal
-1 I'm setting up automated deployment with TRAVIS CI, but my script gets stuck when trying to rsync to my server. From what I can tell, it's the SSH login that's failing, specifically the publickey login. My YAML file ( User , Host , Dir and Key Decryption (openssl aes--256-cbc etc...) replaced) : language: node_js node_js: - 10.7.0 addons: ssh_known_hosts: <HOST> hosts: <HOST> branches: only: - master env: global: - DEPLOY_USER=<USER> - DEPLOY_HOST=<HOST> - DEPLOY_DIRECTORY=<DIR> before_install: - npm install -g npm@6.4.1 install: - npm install script: - npm run build before_deploy: - <DECRYPTION> -in deploy_rsa.enc -out /tmp/deploy_rsa -d - eval "$(ssh-agent -s)" - chmod 600 /tmp/deploy_rsa - ssh-add /tmp/deploy_rsa deploy: provider: script skip_cleanup: true script: rsync -r --delete-after --quiet -e"ssh -v -i /tmp/deploy_rsa" $TRAVIS_BUILD_DIR/dist/ <USER>@<HOST>:<DIR> ...