Skip to content

Instantly share code, notes, and snippets.



Last active Jan 15, 2017
What would you like to do?
Codeship Rakefile to build Jekyll and push to BitBucket
require 'tmpdir'
desc "Generate jekyll site"
task :generate do
puts "## Grabbing data from Contentful..."
system "bundle exec jekyll contentful"
puts "## Creating posts from data files..."
system "ruby dataToPosts.rb"
puts "## Generating Site with Jekyll..."
system "bundle exec jekyll build"
desc "Generate and publish blog to Bitbucket"
task :publish do
Dir.mktmpdir do |tmp|
system "mv _site/* #{tmp}"
system "git checkout -b aerobatic"
system "rm -rf *"
system "mv #{tmp}/* ."
system 'git config --global ""'
system 'git config --global "User Name"'
system "git add ."
system "git commit -am 'Rebuild triggered from Contentful webhook --skip-ci'"
system "git remote add bb"
system "git push -f bb aerobatic"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.