Created
April 26, 2014 03:32
-
-
Save panozzaj/11311040 to your computer and use it in GitHub Desktop.
Jenkins + Jekyll Scheduled Post
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" [email protected] | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment