Skip to content

Commit 727ac19

Browse files
committed
Merge pull request #350 from sproutbox/dev
Basic Vagrant support. Close #348
2 parents 236ca52 + 3c1c9c4 commit 727ac19

File tree

3 files changed

+61
-11
lines changed

3 files changed

+61
-11
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ tmp
1414
*.DS_STORE
1515
build/
1616
.cache
17+
.vagrant
1718

1819
# YARD artifacts
1920
.yardoc
2021
_yardoc
2122
doc/
22-
.idea/
23+
.idea/

README.md

+22-10
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,34 @@ You're going to need:
4343

4444
### Getting Set Up
4545

46-
1. Fork this repository on Github.
47-
2. Clone *your forked repository* (not our original one) to your hard drive with `git clone https://github.com/YOURUSERNAME/slate.git`
48-
3. `cd slate`
49-
4. Install all dependencies: `bundle install`
50-
5. Start the test server: `bundle exec middleman server`
46+
1. Fork this repository on Github.
47+
2. Clone *your forked repository* (not our original one) to your hard drive with `git clone https://github.com/YOURUSERNAME/slate.git`
48+
3. `cd slate`
49+
4. Initialize and start (there are a few options for this):
50+
51+
#### Manual/local
5152

52-
Or use the included Dockerfile! (must install Docker first)
53+
```shell
54+
bundle install
55+
bundle exec middleman server
56+
```
57+
#### Via Docker (must install Docker first)
5358

5459
```shell
5560
docker build -t slate .
5661
docker run -d -p 4567:4567 --name slate -v $(pwd)/source:/app/source slate
57-
```
62+
```
63+
64+
You can now see the docs at http://localhost:4567. Whoa! That was fast!
5865

59-
You can now see the docs at <http://localhost:4567>. Whoa! That was fast!
66+
*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`.*
67+
68+
#### Via Vagrant
69+
```shell
70+
vagrant up
71+
```
6072

61-
*Note: if you're using the Docker setup on OSX, the docs will be
62-
availalable at the output of `boot2docker ip` instead of `localhost:4567`.*
73+
You can now see the docs at http://localhost:4567.
6374

6475
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).
6576

@@ -97,6 +108,7 @@ Examples of Slate in the Wild
97108
* [SocialRadar's LocationKit Docs](https://docs.locationkit.io/)
98109
* [SafetyCulture API Documentation](https://developer.safetyculture.io/)
99110
* [hosting.de API Documentation](https://www.hosting.de/docs/api/)
111+
* [CheddarGetter API Documentation](http://docs.cheddargetter.com)
100112

101113
(Feel free to add your site to this list in a pull request!)
102114

Vagrantfile

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
Vagrant.configure(2) do |config|
2+
config.vm.box = "ubuntu/trusty64"
3+
config.vm.network :forwarded_port, guest: 4567, host: 4567
4+
5+
config.vm.provision "bootstrap",
6+
type: "shell",
7+
inline: <<-SHELL
8+
sudo apt-get update
9+
sudo apt-get install -yq ruby ruby-dev build-essential nodejs git
10+
sudo apt-get autoremove -yq
11+
gem install --no-ri --no-rdoc bundler
12+
SHELL
13+
14+
# add the local user git config to the vm
15+
config.vm.provision "file", source: "~/.gitconfig", destination: ".gitconfig"
16+
17+
config.vm.provision "install",
18+
type: "shell",
19+
privileged: false,
20+
inline: <<-SHELL
21+
echo "=============================================="
22+
echo "Installing app dependencies"
23+
cd /vagrant
24+
bundle install
25+
SHELL
26+
27+
config.vm.provision "run",
28+
type: "shell",
29+
privileged: false,
30+
inline: <<-SHELL
31+
echo "=============================================="
32+
echo "Starting up middleman at http://localhost:4567"
33+
echo "If it does not come up, check the ~/middleman.log file for any error messages"
34+
cd /vagrant
35+
bundle exec middleman server --force-polling -l 1 &> ~/middleman.log &
36+
SHELL
37+
end

0 commit comments

Comments
 (0)