» Vagrant Push

As of version 1.7, Vagrant is capable of deploying or "pushing" application codein the same directory as your Vagrantfile to a remote such as an FTP server.

Pushes are defined in an application's Vagrantfile and are invoked using thevagrant push subcommand. Much like other components of Vagrant, each VagrantPush plugin has its own configuration options. Please consult the documentationfor your Vagrant Push plugin for more information. Here is an example VagrantPush configuration section in a Vagrantfile:

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

When the application is ready to be deployed to the FTP server, just run asingle command:

  1. $ vagrant push

Much like Vagrant Providers, Vagrant Push also supports multiple backenddeclarations. Consider the common scenario of a staging and QA environment:

  1. config.push.define "staging", strategy: "ftp" do |push|
  2. # ...
  3. end
  4. config.push.define "qa", strategy: "ftp" do |push|
  5. # ...
  6. end

In this scenario, the user must pass the name of the Vagrant Push to thesubcommand:

  1. $ vagrant push staging

Vagrant Push is the easiest way to deploy your application. You can read morein the documentation links on the sidebar.