-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for previewing locally (#49)
Uses docker-compose to pull down pages-ready jekyll from Docker Hub. Also lays down a Makefile with targets to lifecycle manage docker-compose resources. This lets you preview changes pre-commit so you dont commit 🚮!
- Loading branch information
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
.PHONY: all fire-up fire-down | ||
.SILENT: banner help | ||
|
||
SHELL := /bin/bash | ||
DOCKERCOMPOSE:= $(shell command -v docker-compose 2> /dev/null) | ||
|
||
default: help | ||
|
||
banner: | ||
echo "" | ||
echo " _ _ ___ _ " | ||
echo " | |_ |_| ___ ___ | _| |_| ___ ___ " | ||
echo " | _| | | | _| | -_| | _| | | _ | _| | -_|" | ||
echo " |_| |_| |_| |___| |_| |_| |_| |_| |___|" | ||
echo "" | ||
|
||
help: banner | ||
grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | ||
|
||
preflight: | ||
ifndef DOCKERCOMPOSE | ||
$(error "docker-compose not found in PATH - is it installed?") | ||
endif | ||
|
||
fire-up: preflight ## Run docker-compose up -d | ||
@docker-compose up -d && \ | ||
sleep 30 && \ | ||
open "http://0.0.0.0:4000/" | ||
|
||
fire-ps: preflight ## Run docker-compose down | ||
@docker-compose ps | ||
|
||
fire-down: preflight ## Run docker-compose down | ||
@docker-compose down | ||
|
||
fire-rm: preflight ## Run docker-compose rm | ||
@docker-compose rm --force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
tirefire: | ||
image: jekyll/jekyll:pages | ||
command: bundle exec jekyll serve | ||
ports: | ||
- 4000:4000 | ||
volumes: | ||
- .:/srv/jekyll |