title: using Jenkins2 pipeline to upload via FTP
body: <p>I'm using the new Jenkins2 pipeline to build a composed project with:</p>
  
  <ul>
  <li>node frontend </li>
  <li>php backend</li>
  </ul>
  
  <p>both are in different repositories hence, the need to use pipeline to sync them, compile, and prepare them to deploy. I cannot find a simple way to deploy using FTP.</p>
  
  <p>My script looks something like this:</p>
  
  <pre><code>node {
      // uncomment these 2 lines and edit the name 'node-4.4.5' according to what you choose in configuration
      def nodeHome = tool name: 'NodeJS 7.2.1', type: 'jenkins.plugins.nodejs.tools.NodeJSInstallation'
      env.PATH = "${nodeHome}/bin:${env.PATH}"
  
      stage("front") {
          dir('front') { // switch to subdir
              git url: ...             
              sh "npm install"
  
              sh "npm run build --prod"
  
              sh "cp -R * ../dist"
          }
      }
  
      stage("back") {
          dir('back') {
              git url: ...
  
              sh 'curl -sS https://getcomposer.org/installer | php'
              sh 'php composer.phar install'
  
              sh "cp -R * ../dist"
          }
      }
      stage("upload via ftp") {
          // IM NOT SURE WHAT TO DO HERE
      }
  }
  </code></pre>
  
  <p><strong>UPDATE 2016-12-16</strong></p>
  
  <p>To clarify what I need is a way to run something similar to "Publish via FTP" like older versions of Jenkins.</p>