Try semi-colons on heredoc

3 jobs for master in 9 minutes and 6 seconds (queued for 1 second)
Status Job ID Name Coverage
  Build
passed #10009911
docker shared
build

00:04:29

 
  Test
passed #10009912
docker shared
test

00:02:17

 
  Deploy
failed #10009913
docker shared
deploy

00:02:20

 
Name Stage Failure
failed
deploy Deploy There is an unknown failure, please try again
invoke-rc.d: policy-rc.d denied execution of restart.
Processing triggers for libc-bin (2.19-18+deb8u7) ...
Processing triggers for systemd (215-17+deb8u6) ...
$ rsync -r --delete-after --quiet ./ $SSH_USER@$DEPLOY_HOST::apilab/
$ ssh $SSH_USER@$DEPLOY_HOST <<-EOF . ~/.bashrc; . ~/.nvm/nvm.sh; nvm use stable; pm2 restart apilab; EOF
/bin/bash: line 69: warning: here-document at line 69 delimited by end-of-file (wanted `EOF')
Warning: Permanently added '162.243.19.214' (ECDSA) to the list of known hosts.
/bin/bash: line 69: /root/.nvm/nvm.sh: No such file or directory
ERROR: Build failed: exit code 1