summaryrefslogtreecommitdiff
path: root/devdocs/vagrant/push%2Findex.html
blob: 86aa70fda71995a20aef44cad1b3f5f00cc29aef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<h1 id="vagrant-push">  Vagrant Push </h1> <p>As of version 1.7, Vagrant is capable of deploying or "pushing" application code in the same directory as your Vagrantfile to a remote such as an FTP server.</p> <p>Pushes are defined in an application's <code>Vagrantfile</code> and are invoked using the <code>vagrant push</code> subcommand. Much like other components of Vagrant, each Vagrant Push plugin has its own configuration options. Please consult the documentation for your Vagrant Push plugin for more information. Here is an example Vagrant Push configuration section in a <code>Vagrantfile</code>:</p> <div class="highlight"><pre class="highlight ruby" data-language="ruby">config.push.define "ftp" do |push|
  push.host = "ftp.company.com"
  push.username = "..."
  # ...
end
</pre></div>
<p>When the application is ready to be deployed to the FTP server, just run a single command:</p> <div class="highlight"><pre class="highlight shell" data-language="shell">$ vagrant push
</pre></div>
<p>Much like <a href="../providers/index" title="Vagrant Providers">Vagrant Providers</a>, Vagrant Push also supports multiple backend declarations. Consider the common scenario of a staging and QA environment:</p> <div class="highlight"><pre class="highlight ruby" data-language="ruby">config.push.define "staging", strategy: "ftp" do |push|
  # ...
end

config.push.define "qa", strategy: "ftp" do |push|
  # ...
end
</pre></div>
<p>In this scenario, the user must pass the name of the Vagrant Push to the subcommand:</p> <div class="highlight"><pre class="highlight shell" data-language="shell">$ vagrant push staging
</pre></div>
<p>Vagrant Push is the easiest way to deploy your application. You can read more in the documentation links on the sidebar.</p><div class="_attribution">
  <p class="_attribution-p">
    &copy; 2010&ndash;2018 Mitchell Hashimoto<br>Licensed under the MPL 2.0 License.<br>
    <a href="https://www.vagrantup.com/docs/push/" class="_attribution-link">https://www.vagrantup.com/docs/push/</a>
  </p>
</div>