Skip to content

Instantly share code, notes, and snippets.

@mseri
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mseri/9e0c5f1c4d3fa7ac2ba4 to your computer and use it in GitHub Desktop.
Save mseri/9e0c5f1c4d3fa7ac2ba4 to your computer and use it in GitHub Desktop.
Pelican blog publish script
#!/usr/bin/env bash
#set -euf -o pipefail
set -ef -o pipefail
echo "Activate Virtual Environment"
source venv/bin/activate
echo "Generate website"
cd struct
pelican content -o output -s publishconf.py
echo "Publish changes"
cd output
git add .
git commit -m "Blog update - `date`"
git push
deactivate
echo "Site published"
echo "Wait 30 sec then push sitemap to google"
sleep 30
wget -q --delete-after http://www.google.com/webmasters/tools/ping?sitemap=http%3A%2F%2Fwww.mseri.me%2Fsitemap.xml
echo "sitemap submitted"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment