grunt-sftp-deploy icon indicating copy to clipboard operation
grunt-sftp-deploy copied to clipboard

Cannot upload two times to the same server

Open amarchen opened this issue 11 years ago • 0 comments
trafficstars

Hi there

I want to execute sftp-deploy two times: once for deploying the client side code (dist->webdir) and one for backend (backend->backend). Both things go to the same server, but two different directories. It seems that only the first call to sftp-deploy proceeds fine, the second one.. copies nothing.

From command line both grunt sftp-deploy:build and grunt sftp-deploy:build run just fine In the composed task only first one is executed fine (in this case it's "build" one): grunt.registerTask('deploy-to-production', [ 'sftp-deploy:build', 'sftp-deploy:backend' ]);

Here's my task definition:

'sftp-deploy': {
      'backend': {
        auth: {
          host: 'myserver.com',
          port: 22,
          authKey: myserver.com'
        },
        src: '<%= yeoman.backend %>',
        dest: '/home/myproject/backend',
        serverSep: '/',
        concurrency: 4,
        progress: true
      },
      'build': {
        auth: {
          host: 'myserver.com',
          port: 22,
          authKey: 'myserver.com'
        },
        src: '<%= yeoman.dist %>',
        dest: '/home/myproject/myserver.com',
        serverSep: '/',
        concurrency: 4,
        progress: true
      }
    }

And here's what I get for the second task if I try running grunt deploy-to-production --verbose:

...first deployment that is fine..
  transferred=[33/33] elapsed=[7.8s] overall=[100%] eta=[0.0s] [========================================]
>> Transferred : 0.59765625 Mb

Running "sftp-deploy:backend" (sftp-deploy) task
Verifying property sftp-deploy.backend exists in config...OK
Files: backend -> /home/myproject/backend
Reading .ftppass...OK
>> Logging in with key at /Users/artem/.ssh/id_rsa
>> Concurrency : 4
Connection :: end undefined
SFTP :: SFTP session closed undefined
SFTP :: close undefined
>> Transferred : 0 Mb
Connection :: close false
Connection :: close false

Done, without errors.

P.S. It is somewhat similar to #19 , but there it was about hanging, in my case second execution is silently ignored.

amarchen avatar Oct 01 '14 23:10 amarchen