Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any good grunt ftp plugin?

I've tried grunt-ftpush and grunt-ftp-deploy but both doesn't work properly. I experience annoyning bugs with them. FTP task seems very important and it's weird that I can't google working one.

UPDATED

Here is settings for grunt-ftp

ftp: { 
  options: { 
    host: 'myhostname',
    user: 'myusername',
    pass: 'mypassword'
  },
  upload: { 
    files: { 
      'codebase/myprojectfolder': 'build/*' 
    }
  }
}

I expect that my local folder build will be copied to the server but I got an error

Fatal error: Unable to read "build/scripts" file (Error code: EISDIR).

Documentation is very poor, so I have no idea how to upload folders which has folders in it.

like image 314
Vitalii Korsakov Avatar asked Jan 02 '14 08:01

Vitalii Korsakov


3 Answers

I tried many FTP plugins and, to my mind, only ftp_push was good enough for me. All other plugins lie on minimap which seemed buggy (when selecting which files to upload or not). Moreover, the idea to use a separate file to handle auth keys has no viable using : if we want to store FTP data in an external JSON file and put it inside our Gruntfile.js, it is not possible at all... The developer should choose by himself what to do with authentification and not rely on an external auth system.

Anyway, the project is alive and Robert-W has fix many issues really quickly : it's a major advantage too when we're developing. Projects that are quite dead are really painful.

https://github.com/Robert-W/grunt-ftp-push

like image 139
pyrsmk Avatar answered Nov 02 '22 04:11

pyrsmk


I have been looking for a actual working way to pushing single files for quite a while, but I come down to using a shell script that makes the ftp call and run the script with grunt-exec (npm link). This seemed way simpler than getting any of the ftp plugins to work. This would work for any *nix system.

script.sh

ftp -niv ftp.host.com << EOF
user foo_user password
cd /path/to/destination
put thefilepush.txt
EOF

Gruntfile.js

exec: {
  ftpupload: {
    command: './script.sh'
  }
}
like image 37
Victor Häggqvist Avatar answered Nov 02 '22 04:11

Victor Häggqvist


Yes grunt-ftp and grunt-sftp-deploy worked well for me.

like image 37
Kahlil Lechelt Avatar answered Nov 02 '22 05:11

Kahlil Lechelt