Makefile 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. PELICAN=./localpelican.sh
  2. PELICANOPTS=
  3. BASEDIR=$(CURDIR)
  4. INPUTDIR=$(BASEDIR)/content
  5. OUTPUTDIR=$(BASEDIR)/output
  6. CONFFILE=$(BASEDIR)/pelicanconf.py
  7. PUBLISHCONF=$(BASEDIR)/publishconf.py
  8. SSH_HOST=mediagoblin.org
  9. SSH_PORT=22
  10. SSH_USER=systems
  11. SSH_TARGET_DIR=/var/www/mediagoblin.org/pelican_build/
  12. SSH_GIT_DIR=/var/www/mediagoblin.org/git_checkout/
  13. STAGING_SSH_TARGET_DIR=/var/www/staging.mediagoblin.org/pelican_build/
  14. STAGING_SSH_GIT_DIR=/var/www/staging.mediagoblin.org/git_checkout/
  15. compile_and_run: html serve
  16. help:
  17. @echo 'Makefile for a pelican Web site '
  18. @echo ' '
  19. @echo 'Usage: '
  20. @echo ' make virtualenv make a virtualenv in place '
  21. @echo ' make html (re)generate the web site '
  22. @echo ' make clean remove the generated files '
  23. @echo ' make regenerate regenerate files upon modification '
  24. @echo ' make serve serve site at http://localhost:8000'
  25. @echo ' make rsync_upload upload the web site via rsync+ssh '
  26. @echo ' make compile_and_run compiles html then runs serve '
  27. @echo ' '
  28. virtualenv:
  29. virtualenv .
  30. ./bin/easy_install -U docutils pelican PasteDeploy PasteScript typogrify
  31. outputdir:
  32. mkdir -p $(OUTPUTDIR)
  33. html: outputdir clean $(OUTPUTDIR)/index.html
  34. @echo 'Done'
  35. $(OUTPUTDIR)/%.html:
  36. $(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
  37. clean:
  38. find $(OUTPUTDIR) -mindepth 1 -delete
  39. regenerate: clean
  40. $(PELICAN) -r $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
  41. serve:
  42. ./runserver.sh
  43. upload:
  44. ssh $(SSH_USER)@$(SSH_HOST) "cd $(SSH_GIT_DIR) && git pull && git reset --hard origin/master && make html"
  45. rsync_upload: upload
  46. staging_upload:
  47. ssh $(SSH_USER)@$(SSH_HOST) "cd $(STAGING_SSH_GIT_DIR) && git pull && git reset --hard origin/draft && make html"
  48. .PHONY: html help clean regenerate serve rsync_upload upload staging_upload