mirror of
https://github.com/danbulant/api_docs
synced 2026-05-27 05:42:42 +00:00
Merge pull request #350 from sproutbox/dev
Basic Vagrant support. Close #348
This commit is contained in:
commit
727ac193ab
3 changed files with 61 additions and 11 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -14,6 +14,7 @@ tmp
|
||||||
*.DS_STORE
|
*.DS_STORE
|
||||||
build/
|
build/
|
||||||
.cache
|
.cache
|
||||||
|
.vagrant
|
||||||
|
|
||||||
# YARD artifacts
|
# YARD artifacts
|
||||||
.yardoc
|
.yardoc
|
||||||
|
|
|
||||||
30
README.md
30
README.md
|
|
@ -43,23 +43,34 @@ You're going to need:
|
||||||
|
|
||||||
### Getting Set Up
|
### Getting Set Up
|
||||||
|
|
||||||
1. Fork this repository on Github.
|
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`
|
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`
|
3. `cd slate`
|
||||||
4. Install all dependencies: `bundle install`
|
4. Initialize and start (there are a few options for this):
|
||||||
5. Start the test server: `bundle exec middleman server`
|
|
||||||
|
|
||||||
Or use the included Dockerfile! (must install Docker first)
|
#### Manual/local
|
||||||
|
|
||||||
|
```shell
|
||||||
|
bundle install
|
||||||
|
bundle exec middleman server
|
||||||
|
```
|
||||||
|
#### Via Docker (must install Docker first)
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
docker build -t slate .
|
docker build -t slate .
|
||||||
docker run -d -p 4567:4567 --name slate -v $(pwd)/source:/app/source 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!
|
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
|
*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`.*
|
||||||
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.
|
||||||
|
|
||||||
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).
|
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 +108,7 @@ Examples of Slate in the Wild
|
||||||
* [SocialRadar's LocationKit Docs](https://docs.locationkit.io/)
|
* [SocialRadar's LocationKit Docs](https://docs.locationkit.io/)
|
||||||
* [SafetyCulture API Documentation](https://developer.safetyculture.io/)
|
* [SafetyCulture API Documentation](https://developer.safetyculture.io/)
|
||||||
* [hosting.de API Documentation](https://www.hosting.de/docs/api/)
|
* [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!)
|
(Feel free to add your site to this list in a pull request!)
|
||||||
|
|
||||||
|
|
|
||||||
37
Vagrantfile
vendored
Normal file
37
Vagrantfile
vendored
Normal file
|
|
@ -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.provision "bootstrap",
|
||||||
|
type: "shell",
|
||||||
|
inline: <<-SHELL
|
||||||
|
sudo apt-get update
|
||||||
|
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
|
||||||
|
|
||||||
|
# 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,
|
||||||
|
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
|
||||||
Loading…
Reference in a new issue