Skip to content

Instantly share code, notes, and snippets.

@sebprunier
Last active January 9, 2019 12:58
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 sebprunier/3fc9d5a539f90ec2f6b2e0f103d55866 to your computer and use it in GitHub Desktop.
Save sebprunier/3fc9d5a539f90ec2f6b2e0f103d55866 to your computer and use it in GitHub Desktop.
#!/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