Oskar Pettersson bio photo

Oskar Pettersson

Researcher in SECOs and TEL. Coder, beer geek and runner in decline.

Twitter Github

With Vagrant 1.7, Hashicorp released a new feature called Push. This site is currently being hosted on a standard PHP-web-hotel-ftp-whatever account, which essentially disqualifies it from any of the hipsteresque ways of deploying anything. Until now.

The push feature simply allows you to transfer the files that you want from your vagrant machine to your remote host. In my case, this is the _site folder which contains my compiled site. This is done by simply typing the following command.

Vagrant push

The ftp component seems broken on Windows (8.1 and 10) hosts as of Vagrant 1.7.4 however. For some reason it mixes the remote directory with the path for the local, which results in the process trying to create a c:\ folder on the remote host.

In the end, my Vagrantfile has the following addition.

config.push.define "ftp" do |push|
	push.host = "host"
	push.username = "username"
	push.password = "password"
	push.dir = "oskarpse/_site"
	push.destination = "remote_directory"
end