Skip to content

Commit

Permalink
Basic support for Vagrant
Browse files Browse the repository at this point in the history
  • Loading branch information
marcguyer committed Oct 6, 2015
1 parent 787eb79 commit 57aa27c
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 14 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ tmp
*.DS_STORE
build/
.cache
.vagrant

# YARD artifacts
.yardoc
_yardoc
doc/
.idea/
.idea/
31 changes: 18 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <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`.*
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).

Expand Down Expand Up @@ -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!)

Expand Down
37 changes: 37 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 57aa27c

Please sign in to comment.