mirror of https://github.com/hashicorp/packer
parent
e2f083b21c
commit
24264ef0dc
@ -1,6 +1,3 @@
|
||||
source "https://rubygems.org"
|
||||
|
||||
gem "middleman-hashicorp",
|
||||
git: "https://github.com/hashicorp/middleman-hashicorp.git"
|
||||
|
||||
gem "htmlbeautifier"
|
||||
gem "middleman-hashicorp", "0.3.12"
|
||||
|
||||
@ -1,22 +1,14 @@
|
||||
all: build
|
||||
|
||||
init:
|
||||
bundle
|
||||
|
||||
docker-dev:
|
||||
docker run -it --expose 4567 -p 4567:4567 -v "$(PWD)":/usr/src/app -w /usr/src/app ruby:2.3.1 \
|
||||
bash -c "apt-get update && apt-get -qy install curl git libgmp3-dev nodejs && \
|
||||
gem install bundler && bundle install && make dev"
|
||||
|
||||
dev: init
|
||||
PACKER_DISABLE_DOWNLOAD_FETCH=true PACKER_VERSION=1.0 bundle exec middleman server
|
||||
|
||||
build: init
|
||||
PACKER_DISABLE_DOWNLOAD_FETCH=true PACKER_VERSION=1.0 bundle exec middleman build
|
||||
|
||||
format:
|
||||
bundle exec htmlbeautifier -t 2 source/*.erb
|
||||
bundle exec htmlbeautifier -t 2 source/layouts/*.erb
|
||||
@pandoc -v > /dev/null || echo "pandoc must be installed in order to format markdown content"
|
||||
pandoc -v > /dev/null && find . -iname "*.html.md" | xargs -I{} bash -c "pandoc -r markdown -w markdown --tab-stop=4 --atx-headers -s --columns=80 {} > {}.new"\; || true
|
||||
pandoc -v > /dev/null && find . -iname "*.html.md" | xargs -I{} bash -c "mv {}.new {}"\; || true
|
||||
VERSION?="0.3.12"
|
||||
|
||||
website:
|
||||
@echo "==> Starting website in Docker..."
|
||||
@docker run \
|
||||
--interactive \
|
||||
--rm \
|
||||
--tty \
|
||||
--publish "4567:4567" \
|
||||
--publish "35729:35729" \
|
||||
--volume "$(shell pwd):/website" \
|
||||
hashicorp/middleman-hashicorp:${VERSION}
|
||||
|
||||
.PHONY: website
|
||||
|
||||
@ -1,33 +1,21 @@
|
||||
# Packer Website
|
||||
# Vault Website
|
||||
|
||||
This subdirectory contains the entire source for the [Packer website](http://www.packer.io).
|
||||
This is a [Middleman](http://middlemanapp.com) project, which builds a static
|
||||
site from these source files.
|
||||
This subdirectory contains the entire source for the [Packer Website][packer].
|
||||
This is a [Middleman][middleman] project, which builds a static site from these
|
||||
source files.
|
||||
|
||||
## Contributions Welcome!
|
||||
|
||||
If you find a typo or you feel like you can improve the HTML, CSS, or
|
||||
JavaScript, we welcome contributions. Feel free to open issues or pull
|
||||
requests like any normal GitHub project, and we'll merge it in.
|
||||
JavaScript, we welcome contributions. Feel free to open issues or pull requests
|
||||
like any normal GitHub project, and we'll merge it in.
|
||||
|
||||
## Running the Site Locally
|
||||
|
||||
Running the site locally is simple. Clone this repo and run the following
|
||||
commands:
|
||||
Running the site locally is simple. Clone this repo and run `make website`.
|
||||
|
||||
```
|
||||
make dev
|
||||
```
|
||||
Then open up `http://localhost:4567`. Note that some URLs you may need to append
|
||||
".html" to make them work (in the navigation).
|
||||
|
||||
Then open up `localhost:4567`. Note that some URLs you may need to append
|
||||
".html" to make them work (in the navigation and such).
|
||||
|
||||
## Keeping Tidy
|
||||
|
||||
To keep the source code nicely formatted, there is a `make format` target. This
|
||||
runs `htmlbeautify` and `pandoc` to reformat the source code so it's nicely formatted.
|
||||
|
||||
make format
|
||||
|
||||
Note that you will need to install pandoc yourself. `make format` will skip it
|
||||
if you don't have it installed.
|
||||
[middleman]: https://www.middlemanapp.com
|
||||
[vault]: https://www.packer.io
|
||||
|
||||
@ -1,27 +0,0 @@
|
||||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
$script = <<SCRIPT
|
||||
sudo apt-get -y update
|
||||
|
||||
# RVM/Ruby
|
||||
sudo apt-get -qy install curl git libgmp3-dev nodejs
|
||||
gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3
|
||||
# Install rvm and the latest version of ruby
|
||||
curl -sSL https://get.rvm.io | bash -s stable
|
||||
. ~/.bashrc
|
||||
. ~/.bash_profile
|
||||
rvm install ruby-2.3.1
|
||||
gem install bundler
|
||||
|
||||
# Middleman deps
|
||||
cd /vagrant
|
||||
make dev
|
||||
SCRIPT
|
||||
|
||||
Vagrant.configure(2) do |config|
|
||||
config.vm.box = "bento/ubuntu-14.04"
|
||||
config.vm.network "private_network", ip: "33.33.30.10"
|
||||
config.vm.provision "shell", inline: $script, privileged: false
|
||||
config.vm.synced_folder ".", "/vagrant", type: "rsync"
|
||||
end
|
||||
Loading…
Reference in new issue