» Vagrant Push

» FTP & SFTP Strategy

Vagrant Push FTP and SFTP strategy pushes the code in your Vagrant developmentenvironment to a remote FTP or SFTP server.

The Vagrant Push FTP And SFTP strategy supports the following configurationoptions:

  • host - The address of the remote (S)FTP server. If the (S)FTP server isrunning on a non-standard port, you can specify the port after the address(host:port).

  • username - The username to use for authentication with the (S)FTP server.

  • password - The password to use for authentication with the (S)FTP server.

  • passive - Use passive FTP (default is true).

  • secure - Use secure (SFTP) (default is false).

  • destination - The root destination on the target system to sync the files(default is /).

  • exclude - Add a file or file pattern to exclude from the upload, relative tothe dir. This value may be specified multiple times and is additive.exclude take precedence over include values.

  • include - Add a file or file pattern to include in the upload, relative tothe dir. This value may be specified multiple times and is additive.

  • dir - The base directory containing the files to upload. By default this isthe same directory as the Vagrantfile, but you can specify this if you havea src folder or bin folder or some other folder you want to upload.

» Usage

The Vagrant Push FTP and SFTP strategy is defined in the Vagrantfile using theftp key:

  1. config.push.define "ftp" do |push|
  2. push.host = "ftp.company.com"
  3. push.username = "username"
  4. push.password = "password"
  5. end

And then push the application to the FTP or SFTP server:

  1. $ vagrant push