Skip to content

Instantly share code, notes, and snippets.

@adesmier adesmier/Rakefile
Last active Jan 15, 2017

Embed
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"
end
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 user.email "user@email.co.uk"'
system 'git config --global user.name "User Name"'
system "git add ."
system "git commit -am 'Rebuild triggered from Contentful webhook --skip-ci'"
system "git remote add bb git@bitbucket.org:ianarber/ianarber.git"
system "git push -f bb aerobatic"
end
end
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.