My blog
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

makefile 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. VERSION := $(shell git rev-parse --abbrev-ref HEAD)
  2. GOBIN = $(GOPATH)/bin
  3. HUGO_BIN = $(GOBIN)/hugo
  4. OPENRING_BIN = $(GOBIN)/openring
  5. serve: assets
  6. ./hugo server -D --log -w --bind 0.0.0.0
  7. new-post:
  8. @./hugo new posts/$(TITLE).md
  9. build: public
  10. docker build -t vdhsn/blog:${VERSION} -f Dockerfile .
  11. publish: clean build
  12. docker push vdhsn/blog:${VERSION}
  13. test-publish: build
  14. docker run -it -p 8080:80 vdhsn/blog:${VERSION}
  15. docker-build-dev:
  16. @docker build --build-arg='VERSION=0.62.0' -t hugo -f Dockerfile.dev .
  17. deploy:
  18. kubectl rollout restart deployment blog
  19. assets: ./assets/css/syntax.css ./layouts/partials/openring.out.html
  20. clean:
  21. @rm -rf ./public ./resources ./assets/css/syntax.css ./layouts/partials/openring.out.html
  22. .PHONY: serve new-post build publish test-publish docker-build-dev assets clean deploy
  23. $(HUGO_BIN):
  24. @go get -u --tags extended -v github.com/gohugoio/hugo
  25. $(OPENRING_BIN):
  26. @go get -u git.sr.ht/~sircmpwn/openring
  27. ./assets/css/syntax.css:
  28. ./hugo gen chromastyles --style=solarized-dark256 > assets/css/syntax.css
  29. ./layouts/partials/openring.out.html: $(OPENRING_BIN)
  30. $(OPENRING_BIN) \
  31. -s https://drewdevault.com/feed.xml \
  32. -s https://dave.cheney.net/feed/atom \
  33. -s https://blog.benjojo.co.uk/rss.xml \
  34. -s https://tech.davis-hansson.com/index.xml \
  35. < ./assets//openring.in.html \
  36. > ./layouts/partials/openring.out.html
  37. public: ./assets/css/syntax.css ./layouts/partials/openring.out.html
  38. ./hugo --minify --gc