Skip to content

Commit

Permalink
tabs in the Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
tobymccann committed Jun 4, 2017
1 parent 95e6d81 commit 80c2855
Show file tree
Hide file tree
Showing 102 changed files with 1,607 additions and 13,389 deletions.
104 changes: 104 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
.idea/

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# dotenv
.env

# virtualenv
.venv
venv/
ENV/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
Would skip repository pelican-plugins/
output/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "themes/pelican-alchemy"]
path = themes/pelican-alchemy
url = https://github.com/nairobilug/pelican-alchemy
3 changes: 3 additions & 0 deletions .idea/dictionaries/jkennemer.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions .idea/tobymccann.github.io-ghp.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

940 changes: 940 additions & 0 deletions .idea/workspace.xml

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
branches:
only:
- master
language: python
python:
- 3.6
sudo: required
services:
- docker
install:
- pip install ghp-import
- git clone https://github.com/getpelican/pelican-plugins
script:
- make github
notifications:
email:
on_success: always
on_failure: always
env:
global:
secure: UKv0Ae4OnqTZTVFCaIh9S1NPbm1+9Q+ptiw7cAWxhGzWcOpgk5I7wqmPE6jdWuwJXTgE8NftZ7mFvN07N75qwxQ9Fl2DU1OcMddzHxOoeAnSdBmhc5yYXPG+7wDcl8N/F54EXw5LAgBROfv9lREs7taUEfexwDAIsumq6o+Y14PJuZ4MsOygy4DAqnDrj6pjuNJ1juBGM1E+WAYyvAqdLavBiVkBpfwkVYw1LIfO04daVYNzMRjGytLigom2yKWeIWOOrYye3ydZ043VCM2cfU20eJXXHGQpcrdWL/X42C2y/gSnyxSJAr+Mjys9CYL5YhbXuwtJpab5tEZeHJiMeXE8tup/Vz5/XavXer+BC6i38IYJuzDpgZiY698Nbao/YLusG8rgGYkj6wa6D1QX86xuzejrMQUD7FOlM7GOJJpHG2DG3aYMJdoPbdQw9D5EhSSWPUgBUFD1wd0Ql/RqHUyQhob8KCj9IoLK0I9UgOmKVZ9Ypvyot6B8haTxR3N7xPk56P0F2KQFPYrWiFRkGoPy63Auh762fexnhle1xUrpgvAIMKBMazq/Dk4w2ZO1o7NzcYxs+oJ63g7qqyJMvBJB0USJGU84jqWuZtDAHcRjJ3QVOcgior7+3D9z8jlIS4Hz7v/QxS6V7dPiPfXiK16bwJkIZfYDV5yQbSCBbCY=
before_install:
- git submodule update --init --recursive
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM python:3.6.1-slim
MAINTAINER tobymccann <[email protected]@>

# Install dependencies
RUN sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list \
&& apt-get update \
&& apt-get -y upgrade \
&& apt-get install \
make \
git -y \
&& pip install pelican Markdown typogrify ghp-import \
&& pip install --upgrade pelican Markdown typogrify ghp-import

RUN git clone https://github.com/getpelican/pelican-plugins /site/

WORKDIR /site
# Need to mount /site/content
CMD pelican content/ -o output/ -s publishconf.py
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2017 Jason Kennemer

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
126 changes: 126 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
PY?=python3
PELICAN?=pelican
PELICANOPTS=

BASEDIR=$(CURDIR)
INPUTDIR=$(BASEDIR)/content
OUTPUTDIR=$(BASEDIR)/output
CONFFILE=$(BASEDIR)/pelicanconf.py
PUBLISHCONF=$(BASEDIR)/publishconf.py

FTP_HOST=localhost
FTP_USER=anonymous
FTP_TARGET_DIR=/

SSH_HOST=localhost
SSH_PORT=22
SSH_USER=root
SSH_TARGET_DIR=/var/www

S3_BUCKET=my_s3_bucket

CLOUDFILES_USERNAME=my_rackspace_username
CLOUDFILES_API_KEY=my_rackspace_api_key
CLOUDFILES_CONTAINER=my_cloudfiles_container

DROPBOX_DIR=~/Dropbox/Public/

GITHUB_PAGES=tobymccann/tobymccann.github.io.git
GITHUB_PAGES_BRANCH=master

DEBUG ?= 0
ifeq ($(DEBUG), 1)
PELICANOPTS += -D
endif

RELATIVE ?= 0
ifeq ($(RELATIVE), 1)
PELICANOPTS += --relative-urls
endif

help:
@echo 'Makefile for a pelican Web site '
@echo ' '
@echo 'Usage: '
@echo ' make html (re)generate the web site '
@echo ' make clean remove the generated files '
@echo ' make regenerate regenerate files upon modification '
@echo ' make publish generate using production settings '
@echo ' make serve [PORT=8000] serve site at http://localhost:8000'
@echo ' make serve-global [SERVER=0.0.0.0] serve (as root) to $(SERVER):80 '
@echo ' make devserver [PORT=8000] start/restart develop_server.sh '
@echo ' make stopserver stop local server '
@echo ' make ssh_upload upload the web site via SSH '
@echo ' make rsync_upload upload the web site via rsync+ssh '
@echo ' make dropbox_upload upload the web site via Dropbox '
@echo ' make ftp_upload upload the web site via FTP '
@echo ' make s3_upload upload the web site via S3 '
@echo ' make cf_upload upload the web site via Cloud Files'
@echo ' make github upload the web site via gh-pages '
@echo ' '
@echo 'Set the DEBUG variable to 1 to enable debugging, e.g. make DEBUG=1 html '
@echo 'Set the RELATIVE variable to 1 to enable relative urls '
@echo ' '

html:
$(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)

clean:
[ ! -d $(OUTPUTDIR) ] || rm -rf $(OUTPUTDIR)

regenerate:
$(PELICAN) -r $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)

serve:
ifdef PORT
cd $(OUTPUTDIR) && $(PY) -m pelican.server $(PORT)
else
cd $(OUTPUTDIR) && $(PY) -m pelican.server
endif

serve-global:
ifdef SERVER
cd $(OUTPUTDIR) && $(PY) -m pelican.server 80 $(SERVER)
else
cd $(OUTPUTDIR) && $(PY) -m pelican.server 80 0.0.0.0
endif


devserver:
ifdef PORT
$(BASEDIR)/develop_server.sh restart $(PORT)
else
$(BASEDIR)/develop_server.sh restart
endif

stopserver:
$(BASEDIR)/develop_server.sh stop
@echo 'Stopped Pelican and SimpleHTTPServer processes running in background.'

publish:
# $(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(PUBLISHCONF) $(PELICANOPTS)
sudo bash docker_run.sh

ssh_upload: publish
scp -P $(SSH_PORT) -r $(OUTPUTDIR)/* $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR)

rsync_upload: publish
rsync -e "ssh -p $(SSH_PORT)" -P -rvzc --delete $(OUTPUTDIR)/ $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) --cvs-exclude

dropbox_upload: publish
cp -r $(OUTPUTDIR)/* $(DROPBOX_DIR)

ftp_upload: publish
lftp ftp://$(FTP_USER)@$(FTP_HOST) -e "mirror -R $(OUTPUTDIR) $(FTP_TARGET_DIR) ; quit"

s3_upload: publish
s3cmd sync $(OUTPUTDIR)/ s3://$(S3_BUCKET) --acl-public --delete-removed --guess-mime-type --no-mime-magic --no-preserve

cf_upload: publish
cd $(OUTPUTDIR) && swift -v -A https://auth.api.rackspacecloud.com/v1.0 -U $(CLOUDFILES_USERNAME) -K $(CLOUDFILES_API_KEY) upload -c $(CLOUDFILES_CONTAINER) .

github: publish
ghp-import -m "Generate Pelican site" -b $(GITHUB_PAGES_BRANCH) $(OUTPUTDIR)
git push -fq https://${GH_TOKEN}@github.com/$(GITHUB_PAGES).git master

.PHONY: html help clean regenerate serve serve-global devserver stopserver publish ssh_upload rsync_upload dropbox_upload ftp_upload s3_upload cf_upload github
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# tobymccann.github.io-ghp
github pages source
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions content/pelican-docker-ghp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Title: Using Pelican Docker & Github Pages
Date: 2017-05-28 07:30
Category: Tutorial
Author: Jason Kennemer
Tags: pelican, publishing, docker, tutorial

I am documenting my effort to run a blog using the python-based static site generator, [Pelican](http://getpelican.com),
running on GitHub Pages and using a Docker container for development workflow. I'm not sure if its going to work the way
I want however.
Loading

0 comments on commit 80c2855

Please sign in to comment.