Package: pelicangit
pelicangit is a python script that will automatically build your Pelican powered blog whenever you push a blog post into git.The script will start a simple HTTP server. When the server recieves a POST (from a git service hook, indicating you have pushed a new blog post in markdown or restructuredtext), it will pull down these updates, run pelican to compile them to HTML and then commit and push the resulting HTML into another git repository (e.g. a github pages repo). This can be especially useful when writing blog posts on a client which cannot run pelican locally (e.g. a chromebook)Note: Currently pelicangit only works on unix environments and has only been tested on Ubuntu.Quick StartIf you havepelicanandpipinstalled, simply runsudo pip install pelicangitto installCopy your pelican configuration to/etc/pelicangit/pelican.conf.pyand add the variables specified in theExtra Pelican SettingssectionRun withsudo start pelicangitInstallingPrerequisites:InstallsetuptoolsInstallpipwithcurlhttps://raw.github.com/pypa/pip/master/contrib/get-pip.py| sudo pythonInstallpelicanwithsudo pip install pelicanBe sure to install markdown if required withsudo pip install Markdownand any themes you require withpelican-themesInstalling pelicangit:Runsudo pip install pelicangitExtra Pelican SettingsAdd these variables to your pelican config file (the file you normally pass with the-sargument to pelican)PELICANGIT_SOURCE_REPO="/path/to/source/markdown/repo"
PELICANGIT_SOURCE_REMOTE="origin"
PELICANGIT_SOURCE_BRANCH="master"

PELICANGIT_DEPLOY_REPO="/path/to/deploy/html/repo"
PELICANGIT_DEPLOY_REMOTE="origin"
PELICANGIT_DEPLOY_BRANCH="master"

PELICANGIT_USER = "ubuntu"
PELICANGIT_WHITELISTED_FILES = [
    "README.md"
]

PELICANGIT_PORT=8080PELICANGIT_SOURCE_REPOis the git repo you push new blog articles to in markdown or restructuredtext.PELICANGIT_DEPLOY_REPOis the git repo pelicangit will push your HTML converted blog articles to.PELICANGIT_USERis the name of the unix user that will be used to run the git and pelican commands. Ensure this user has a valid SSH keypair to pull/push from/to the git repositories.GIT_WHITELISTED_FILESis a list of files pelicangit will not delete. By default, pelicangit assumes everything in thePELICANGIT_DEPLOY_REPOgit repo is the output from pelican, and everytime it runs, it does agit rmon all files before regenerating your entire blog. If you have any files in yourPELICANGIT_DEPLOY_REPOthat are not the output from pelican then add them to this whitelist variable. I currently use this for a google webmaster tools verification html file and a github readme file.PELICANGIT_PORTis the port the pelicangit will listen on for the git service hook you will configure in the next stepSetup your git hookThe git service hook is the mechanism which informs pelicangit whenever you commit content (markdown/restructuredtext) to yourPELICANGIT_SOURCE_REPOand gets it to kick off pelican.
For github:Go to your github repo where you keep your source markdown (i.e. thePELICANGIT_SOURCE_REPOyou set in step 2)Click the ‘Administration’ buttonClick ‘Service Hooks’ from the left hand navClick ‘Post-Receive URLs’ service hookAdd the URL/IP of the server you are running pelicangit. The port will be the value used in thePELICANGIT_PORTsetting from step 2.Once you have pelicangit running (see instructions below) you can use the ‘Test Hook’ button to check the hook is workingRunning pelicangitRunning with Upstartsudo start pelicangitUpstart will keep pelicangit long running (will restart it if it crashes, or the machine reboots). By installing pelicangit, an upstart configuration file will be installed at/etc/init/pelicangit.conf.When running with upstart, pelicangit will look for your pelican configuration file at/etc/pelicangit/pelican.conf.py. This will be the only argument pelicangit passed to pelican, so you will need to use thePATHandOUTPUT_PATHvariables to define where your content and output paths are as definedhereRunning DirectlyCall thepelicangitwith the same arguments you would call pelican. For example:pelicangit-s/path/to/pelican.conf.py /path/to/markdownLoggingIf you need to do any debugging, logs currently live at/home/${PELICANGIT_USER}/pelicangit.logwherePELICANGIT_USERis the variable specified in your pelican config file.Source CodeIf you are reading this onhttp://pypi.python.orgyou can access the source code athttp://github.com/theon/pelicangitAlso See
========Blog article