From 051904d530aaf02068334b8046c3e93fe81c0bd8 Mon Sep 17 00:00:00 2001 From: Lars Henrik Mai Date: Fri, 2 May 2014 12:55:40 +0200 Subject: add vagrant file and update README --- .gitignore | 3 ++ README | 43 +++++++++++++++++++- Vagrantfile | 132 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ config.rb | 2 +- 4 files changed, 178 insertions(+), 2 deletions(-) create mode 100644 Vagrantfile diff --git a/.gitignore b/.gitignore index 6129add..4a22002 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,6 @@ # old-news should be ignored /old-news + +# Ignore vagrant stuff +/.vagrant diff --git a/README b/README index 9622006..0a4e5bf 100644 --- a/README +++ b/README @@ -20,6 +20,33 @@ Versuch einer mobile-first sublab website mit middleman (http://middlemanapp.com (edit files in the source/ directory, browser should autorefresh) +== Using Vagrant + +Install Vagrant from here: http://www.vagrantup.com/downloads.html + + # start the VM; this may take a while on first boot + vagrant up + + # .. then start the middleman development server in the VM + # (polling is needed because changes to files don't propagate via virtualbox shared folders) + + vagrant ssh -c "cd /vagrant; bundle exec middleman server --force-polling --latency=4" + + # on the hostmachine, open http://localhost:4567 + + # to shutdown the VM: + vagrant halt + + # to force quit the VM in case Vagrant hangs: + vagrant halt -f + + # to reload the VM after changes to Vagrantfile: + vagrant reload + + # anything else: + vagrant -h + vagrant -h + == Building bundle exec middleman build @@ -28,6 +55,19 @@ Versuch einer mobile-first sublab website mit middleman (http://middlemanapp.com ruby -run -e httpd ./build -p 5000 open http://localhost:5000 +== Updating + + # update the code + git pull + + # update gem dependencies if needed + + # using vagrant: + vagrant ssh -c "cd /vagrant; bundle" + + # otherwise just: + bundle + == Problems / Features * No CSS yet @@ -38,4 +78,5 @@ Versuch einer mobile-first sublab website mit middleman (http://middlemanapp.com * implement a mobile-first grid using Bootstrap * write a sensible API server for the status box -* add middleman blog extension and migrate old posts + + diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..09e0bc7 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,132 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! +VAGRANTFILE_API_VERSION = "2" + +$provision = < "present", + # # } + # # + # # File { owner => 0, group => 0, mode => 0644 } + # # + # # file { '/etc/motd': + # # content => "Welcome to your Vagrant-built virtual machine! + # # Managed by Puppet.\n" + # # } + # + # config.vm.provision "puppet" do |puppet| + # puppet.manifests_path = "manifests" + # puppet.manifest_file = "site.pp" + # end + + # Enable provisioning with chef solo, specifying a cookbooks path, roles + # path, and data_bags path (all relative to this Vagrantfile), and adding + # some recipes and/or roles. + # + # config.vm.provision "chef_solo" do |chef| + # chef.cookbooks_path = "../my-recipes/cookbooks" + # chef.roles_path = "../my-recipes/roles" + # chef.data_bags_path = "../my-recipes/data_bags" + # chef.add_recipe "mysql" + # chef.add_role "web" + # + # # You may also specify custom JSON attributes: + # chef.json = { :mysql_password => "foo" } + # end + + # Enable provisioning with chef server, specifying the chef server URL, + # and the path to the validation key (relative to this Vagrantfile). + # + # The Opscode Platform uses HTTPS. Substitute your organization for + # ORGNAME in the URL and validation key. + # + # If you have your own Chef Server, use the appropriate URL, which may be + # HTTP instead of HTTPS depending on your configuration. Also change the + # validation key to validation.pem. + # + # config.vm.provision "chef_client" do |chef| + # chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME" + # chef.validation_key_path = "ORGNAME-validator.pem" + # end + # + # If you're using the Opscode platform, your validator client is + # ORGNAME-validator, replacing ORGNAME with your organization name. + # + # If you have your own Chef Server, the default validation client name is + # chef-validator, unless you changed the configuration. + # + # chef.validation_client_name = "ORGNAME-validator" +end diff --git a/config.rb b/config.rb index bf12a20..a90a2aa 100644 --- a/config.rb +++ b/config.rb @@ -72,7 +72,7 @@ page "/feed.xml", layout: false # activate :automatic_image_sizes # Reload the browser automatically whenever files change -activate :livereload +activate :livereload, host: "0.0.0.0" # Methods defined in the helpers block are available in templates # helpers do -- cgit v1.2.1