Last active
January 9, 2019 12:58
-
-
Save sebprunier/3fc9d5a539f90ec2f6b2e0f103d55866 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
safeCheck () { | |
if [ $1 -ne 0 ]; then | |
echo "An error occured during Jekyll build :-( Exiting..." | |
exit 1 | |
fi | |
} | |
executeCommand () { | |
echo "Executing command: $1" | |
eval $1 | |
safeCheck $? | |
} | |
echo "Running Jekyll build..." | |
# Check that Ruby is installed... | |
executeCommand "ruby -v" | |
# Use local folder to store gems and add binaries to path | |
export GEM_HOME=$HOME/gems | |
export PATH=$HOME/gems/bin:$PATH | |
export JEKYLL_ENV=production | |
# Install Bundler | |
executeCommand "gem install bundler -v 1.17.3" | |
# Install Jekyll | |
executeCommand "gem install jekyll -v 3.8.5" | |
# Install dependencies | |
executeCommand "bundle install" | |
# Running build | |
executeCommand "bundle exec jekyll build" | |
echo "Jekyll build done!" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment