Skip to content

Instantly share code, notes, and snippets.

@panozzaj
Created April 26, 2014 03:32
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 panozzaj/11311040 to your computer and use it in GitHub Desktop.
Save panozzaj/11311040 to your computer and use it in GitHub Desktop.
Jenkins + Jekyll Scheduled Post
#!/bin/bash -l
set -e
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
export PATH
export LANG="en_US.UTF-8"
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
gem --version
rvm use `cat .ruby-version`@`cat .ruby-gemset`
bundle install
./scripts/publish_scheduled
if git diff-index --quiet HEAD --; then
echo "There were no files newly published, so not going to deploy."
else
echo "Some files were modified. Adding them in an automated commit."
git add -A
git commit -m "Automated commit - scheduled post (`date`)"
git push origin master
cp /Users/anthonypanozzo/Documents/dev/22ideastreet/blog/scripts/set_env.sh ./scripts/set_env.sh
echo "Going to deploy..."
echo ""
./scripts/deploy staging
./scripts/deploy production
echo "Published a scheduled post on http://www.22ideastreet.com/blog." | mail -s "Published a scheduled post" panozzaj@gmail.com
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment