title: How to setup deployment to the remote SSH server using pipelines
body: <p>I'm creating pipeline which will responsible to run deployment script on my remote server when I commit changes to develop branch. I am using laravel envoyer. what I need is just to run <code>envoy run deploy</code> on my remote server after commit. </p>
  
  <p>I was using steps described <a href="https://confluence.atlassian.com/bitbucket/use-ssh-keys-in-bitbucket-pipelines-847452940.html" rel="nofollow noreferrer">here</a></p>
  
  <p>Here is bitbucket-pipelines.yml config </p>
  
  <pre><code>pipelines:
   branches:
    develop:
     - step:
      script:
       - ssh -t user@example.com
       - cd /var/www/project_folder/html
       - envoy run deploy
  </code></pre>
  
  <p>Infinite execution happening and I get following message </p>
  
  <p>Pseudo-terminal will not be allocated because stdin is not a terminal.
  Warning: Permanently added the RSA host key for IP address '104.236.241.243' to the list of known hosts.
  Welcome to Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-138-generic x86_64)
   * Documentation:  <a href="https://help.ubuntu.com" rel="nofollow noreferrer">https://help.ubuntu.com</a>
   * Management:     <a href="https://landscape.canonical.com" rel="nofollow noreferrer">https://landscape.canonical.com</a>
   * Support:        <a href="https://ubuntu.com/advantage" rel="nofollow noreferrer">https://ubuntu.com/advantage</a>
    Get cloud support with Ubuntu Advantage Cloud Guest:
      <a href="http://www.ubuntu.com/business/services/cloud" rel="nofollow noreferrer">http://www.ubuntu.com/business/services/cloud</a>
  156 packages can be updated.
  0 updates are security updates.
  <strong>* System restart required *</strong>
  mesg: ttyname failed: Inappropriate ioctl for device</p>