Permalink
Browse files

Merge p14n article branch

  • Loading branch information...
2 parents 91dc07d + 7a0153e commit df17eb6e9d1e3828cfe57d53eb5924305c217a57 @todayispotato todayispotato committed Feb 21, 2014
View
@@ -4,3 +4,9 @@
output/
*.pid
*.pyc
+/bin
+/lib
+/include
+/.env
+/env
+.Python
View
@@ -13,6 +13,9 @@ INPUTDIR=$(BASEDIR)/content
OUTPUTDIR=$(BASEDIR)/output
CONFFILE=$(BASEDIR)/pelicanconf.py
PUBLISHCONF=$(BASEDIR)/publishconf.py
+PATH := $(BASEDIR)/.env/bin:$(PATH)
+
+DEVSERVER_PORT=8000
help:
@echo 'Makefile for the Paylogic developer portal'
@@ -36,22 +39,24 @@ $(OUTPUTDIR)/%.html:
clean:
[ ! -d $(OUTPUTDIR) ] || find $(OUTPUTDIR) -mindepth 1 -delete
+ rm -rf .env
-regenerate: clean
+regenerate: clean .env
$(PELICAN) -r $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
-serve:
+serve: .env
cd $(OUTPUTDIR) && $(PY) -m pelican.server
-devserver:
- $(BASEDIR)/develop_server.sh restart
+devserver: .env
+ export
+ $(BASEDIR)/develop_server.sh restart $(DEVSERVER_PORT)
-stopserver:
- kill -9 `cat pelican.pid`
- kill -9 `cat srv.pid`
+stopserver: .env
+ export
+ $(BASEDIR)/develop_server.sh stop $(DEVSERVER_PORT)
@echo 'Stopped Pelican and SimpleHTTPServer processes running in background.'
-publish:
+publish: .env
$(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(PUBLISHCONF) $(PELICANOPTS)
github: publish
@@ -68,4 +73,8 @@ github: publish
# Publish the updated site to GitHub.
git push origin master gh-pages
+.env:
+ virtualenv .env
+ .env/bin/pip install -r requirements.txt
+
.PHONY: html help clean regenerate serve devserver publish github
View
@@ -8,6 +8,7 @@ generate the web pages from content written in the reStructuredText_ format.
The git repository is hosted on our GitHub_ account and we use `GitHub Pages`_
with a custom DNS name for hosting.
+
Running it locally
------------------
@@ -17,15 +18,11 @@ following steps should help you get started::
# Clone the git repository.
git clone git@github.com:paylogic/dev-portal.git
- # Create, activate and initialize the virtual environment.
- virtualenv ~/.virtualenvs/dev-portal
- source ~/.virtualenvs/dev-portal/bin/activate
- pip install -r dev-portal/requirements.txt
-
# Run Pelican and view the result in a web browser.
cd dev-portal
- make devserver
- gnome-open http://127.0.0.1:8000
+ make devserver [DEVSERVER_PORT=<port>]
+ gnome-open http://127.0.0.1:8000 # DEVSERVER_PORT is 8000 by default
+
Publishing changes
------------------
@@ -35,6 +32,7 @@ and 3) have activated the virtual environment, then all you need to publish the
latest changes to the live website is to run the command ``make github``. This
will publish your changes using `GitHub Pages`_.
+
License
-------
Oops, something went wrong.

0 comments on commit df17eb6

Please sign in to comment.