From 80a1c7f05872b7485651d3d937b71119430ffc70 Mon Sep 17 00:00:00 2001 From: Jonathan Sharpe Date: Thu, 1 Aug 2019 11:17:54 +0100 Subject: [PATCH] Allow env var to override Pelican config file It is common to use pelicanconf.py for local development and then publishconf.py for production - allowing this to be configurable lets people manage multiple Pelican configs as required. --- README.md | 1 + entrypoint.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3efc0f6..4bbefce 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ Please ensure a `requirements.txt` is present for your site and installs ## Environment variables - `GH_PAGES_BRANCH` (optional): override the default `gh-pages` deployment branch + - `PELICAN_CONFIG_FILE` (optional): override the default `pelicanconf.py` config file ## History diff --git a/entrypoint.sh b/entrypoint.sh index 0dfc1e3..058b9f0 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -13,7 +13,7 @@ ssh-keyscan -t rsa github.com > /root/.ssh/known_hosts && \ echo "${GIT_DEPLOY_KEY}" > /root/.ssh/id_rsa && \ chmod 400 /root/.ssh/id_rsa echo '=================== Build site ===================' -pelican content -o output -s pelicanconf.py +pelican content -o output -s ${PELICAN_CONFIG_FILE:=pelicanconf.py} echo '=================== Publish to GitHub Pages ===================' cd output # shellcheck disable=SC2012