diff options
-rw-r--r-- | Vagrantfile | 9 | ||||
-rw-r--r-- | vagrant/bootstrap.sh | 12 | ||||
-rw-r--r-- | vagrant/rails.service | 12 |
3 files changed, 33 insertions, 0 deletions
diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..b685bb5 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,9 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +Vagrant.configure("2") do |config| + config.vm.box = "vagrant-archlinux-2013-8" + config.vm.box_url = "https://googledrive.com/host/0B_BLFE4aPn5zUVpyaHdLanVnMTg/vagrant-archlinux-2013-8.box" + config.vm.provision :shell, :path => "vagrant/bootstrap.sh" + config.vm.network :forwarded_port, host: 4567, guest: 80 +end diff --git a/vagrant/bootstrap.sh b/vagrant/bootstrap.sh new file mode 100644 index 0000000..14c42f3 --- /dev/null +++ b/vagrant/bootstrap.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +pacman -Suyq --noconfirm +pacman -Sq ruby gcc make sqlite3 nodejs --noconfirm +echo "export GEM_HOME=`gem env gemdir`" > /etc/profile.d/rubygems.sh +source /etc/profile.d/rubygems.sh +gem install bundler --no-rdoc --no-ri --no-user-install +cd /vagrant +./script/setup +cp vagrant/rails.service /usr/lib/systemd/system +systemctl enable rails +systemctl start rails diff --git a/vagrant/rails.service b/vagrant/rails.service new file mode 100644 index 0000000..c37116e --- /dev/null +++ b/vagrant/rails.service @@ -0,0 +1,12 @@ +[Unit] +Description="Systemd service to boot rails server when booting VM" + +[Install] +WantedBy=multi-user.target +After=remote-fs.target +After=dhcpcd.service + +[Service] +Type=simple +ExecStart=/vagrant/script/rails server --port=80 + |