danielrayjones/Makefile

24 lines
693 B
Makefile
Raw Normal View History

.PHONY: all serve clean
2019-08-19 11:29:07 -05:00
2017-06-04 22:05:40 -05:00
export PATH := $(HOME)/bin:$(PATH):/usr/local/bin
PORT ?= 4000
IMAGE=danjones000/danielrayjones/ruby-with-bundler:1.0.0
2017-06-04 22:05:40 -05:00
all: serve
2017-06-04 22:05:40 -05:00
.image: Gemfile Gemfile.lock
2019-08-19 11:29:07 -05:00
docker build -t $(IMAGE) .
docker image inspect $(IMAGE) | jq -r '.[0].Id' | tee .image
2019-08-19 11:29:07 -05:00
2020-02-20 16:48:05 -06:00
_config.local.yml:
touch $@
_site/index.html: .image _config.local.yml
2019-08-19 11:29:07 -05:00
docker run -u $(shell id -u) --rm -v $(shell pwd):/app -w /app $(IMAGE) bundle exec jekyll build -c '_config.yml,_config.local.yml'
serve: _site/index.html
docker run --rm -it -v $(shell pwd):/app -w /app -p $(PORT):$(PORT) $(IMAGE) bundle exec jekyll serve -H 0.0.0.0 -P "$(PORT)" -c '_config.yml,_config.local.yml'
2017-06-04 22:05:40 -05:00
2019-08-19 11:29:07 -05:00
clean:
rm -rf _site