From 57aa27c0eb0474733bb115b63991ba2509d2bedc Mon Sep 17 00:00:00 2001 From: Marc Guyer Date: Tue, 6 Oct 2015 10:51:23 -0400 Subject: [PATCH 1/5] Basic support for Vagrant --- .gitignore | 3 ++- README.md | 31 ++++++++++++++++++------------- Vagrantfile | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 14 deletions(-) create mode 100644 Vagrantfile diff --git a/.gitignore b/.gitignore index f6fc8c0..f1953e3 100644 --- a/.gitignore +++ b/.gitignore @@ -14,9 +14,10 @@ tmp *.DS_STORE build/ .cache +.vagrant # YARD artifacts .yardoc _yardoc doc/ -.idea/ \ No newline at end of file +.idea/ diff --git a/README.md b/README.md index 2f042e7..b2e4105 100644 --- a/README.md +++ b/README.md @@ -43,23 +43,27 @@ You're going to need: ### Getting Set Up - 1. Fork this repository on Github. - 2. Clone *your forked repository* (not our original one) to your hard drive with `git clone https://github.com/YOURUSERNAME/slate.git` - 3. `cd slate` - 4. Install all dependencies: `bundle install` - 5. Start the test server: `bundle exec middleman server` - -Or use the included Dockerfile! (must install Docker first) - +1. Fork this repository on Github. +2. Clone *your forked repository* (not our original one) to your hard drive with `git clone https://github.com/YOURUSERNAME/slate.git` +3. `cd slate` +4. Initialize and start + * Manually: +```shell +bundle install +bundle exec middleman server +``` + * Or via Docker (must install Docker first) ```shell docker build -t slate . docker run -d -p 4567:4567 --name slate -v $(pwd)/source:/app/source slate +``` + You can now see the docs at http://localhost:4567. Whoa! That was fast! Note: if you're using the Docker setup on OSX, the docs will be + availalable at the output of `boot2docker ip` instead of `localhost:4567`. + * Or via Vagrant +```shell +vagrant up ``` - -You can now see the docs at . Whoa! That was fast! - -*Note: if you're using the Docker setup on OSX, the docs will be -availalable at the output of `boot2docker ip` instead of `localhost:4567`.* + You can now see the docs at http://localhost:4567. Now that Slate is all set up your machine, you'll probably want to learn more about [editing Slate markdown](https://github.com/tripit/slate/wiki/Markdown-Syntax), or [how to publish your docs](https://github.com/tripit/slate/wiki/Deploying-Slate). @@ -97,6 +101,7 @@ Examples of Slate in the Wild * [SocialRadar's LocationKit Docs](https://docs.locationkit.io/) * [SafetyCulture API Documentation](https://developer.safetyculture.io/) * [hosting.de API Documentation](https://www.hosting.de/docs/api/) +* [CheddarGetter API Documentation](http://docs.cheddargetter.com) (Feel free to add your site to this list in a pull request!) diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..f00c7d1 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,37 @@ +Vagrant.configure(2) do |config| + config.vm.box = "ubuntu/trusty64" + config.vm.network :forwarded_port, guest: 4567, host: 4567 + config.vm.provider "virtualbox" do |vb| + vb.memory = "384" + end + + config.vm.provision "bootstrap", + type: "shell", + inline: <<-SHELL + sudo apt-get update + sudo apt-get install -yq ruby ruby-dev build-essential nodejs + sudo apt-get autoremove -yq + gem install --no-ri --no-rdoc bundler + SHELL + + config.vm.provision "install", + type: "shell", + privileged: false, + inline: <<-SHELL + echo "==============================================" + echo "Installing app dependencies" + cd /vagrant + bundle install + SHELL + + config.vm.provision "run", + type: "shell", + privileged: false, + inline: <<-SHELL + echo "==============================================" + echo "Starting up middleman at http://localhost:4567" + echo "If it does not come up, check the ~/middleman.log file for any error messages" + cd /vagrant + bundle exec middleman server --force-polling -l 1 &> ~/middleman.log & + SHELL +end From 4136f7b0f795e091c0e793e3b7d7580e7c7f465d Mon Sep 17 00:00:00 2001 From: Marc Guyer Date: Tue, 6 Oct 2015 16:48:51 -0400 Subject: [PATCH 2/5] Formatting fixes for README --- README.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b2e4105..9384a57 100644 --- a/README.md +++ b/README.md @@ -46,24 +46,31 @@ You're going to need: 1. Fork this repository on Github. 2. Clone *your forked repository* (not our original one) to your hard drive with `git clone https://github.com/YOURUSERNAME/slate.git` 3. `cd slate` -4. Initialize and start - * Manually: +4. Initialize and start (there are a few options for this): + +#### Manual/local + ```shell bundle install bundle exec middleman server ``` - * Or via Docker (must install Docker first) +#### Via Docker (must install Docker first) + ```shell docker build -t slate . docker run -d -p 4567:4567 --name slate -v $(pwd)/source:/app/source slate ``` - You can now see the docs at http://localhost:4567. Whoa! That was fast! Note: if you're using the Docker setup on OSX, the docs will be - availalable at the output of `boot2docker ip` instead of `localhost:4567`. - * Or via Vagrant + +You can now see the docs at http://localhost:4567. Whoa! That was fast! + +*Note: if you're using the Docker setup on OSX, the docs will be availalable at the output of `boot2docker ip` instead of `localhost:4567`.* + +#### Via Vagrant ```shell vagrant up ``` - You can now see the docs at http://localhost:4567. + +You can now see the docs at http://localhost:4567. Now that Slate is all set up your machine, you'll probably want to learn more about [editing Slate markdown](https://github.com/tripit/slate/wiki/Markdown-Syntax), or [how to publish your docs](https://github.com/tripit/slate/wiki/Deploying-Slate). From ce2f2ae8de02aeab1feaff0d3786d4afe8a2bf88 Mon Sep 17 00:00:00 2001 From: Marc Guyer Date: Tue, 6 Oct 2015 17:12:55 -0400 Subject: [PATCH 3/5] Update Vagrantfile Need git for `rake publish` --- Vagrantfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index f00c7d1..713d884 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -9,7 +9,7 @@ Vagrant.configure(2) do |config| type: "shell", inline: <<-SHELL sudo apt-get update - sudo apt-get install -yq ruby ruby-dev build-essential nodejs + sudo apt-get install -yq ruby ruby-dev build-essential nodejs git sudo apt-get autoremove -yq gem install --no-ri --no-rdoc bundler SHELL From 4a3fdfaea2e9f5017d9ed5cffbcbfae0630c5c76 Mon Sep 17 00:00:00 2001 From: Marc Guyer Date: Tue, 6 Oct 2015 17:21:17 -0400 Subject: [PATCH 4/5] Update Vagrantfile More memory needed for `rake publish` --- Vagrantfile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 713d884..ba6b620 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,9 +1,6 @@ Vagrant.configure(2) do |config| config.vm.box = "ubuntu/trusty64" config.vm.network :forwarded_port, guest: 4567, host: 4567 - config.vm.provider "virtualbox" do |vb| - vb.memory = "384" - end config.vm.provision "bootstrap", type: "shell", From 3c1c9c49d54828fe9a7dd73edbbccef54bf52078 Mon Sep 17 00:00:00 2001 From: Marc Guyer Date: Thu, 8 Oct 2015 14:09:27 +0000 Subject: [PATCH 5/5] Add local git config to guest vm --- Vagrantfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Vagrantfile b/Vagrantfile index ba6b620..186654e 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -11,6 +11,9 @@ Vagrant.configure(2) do |config| gem install --no-ri --no-rdoc bundler SHELL + # add the local user git config to the vm + config.vm.provision "file", source: "~/.gitconfig", destination: ".gitconfig" + config.vm.provision "install", type: "shell", privileged: false,