Last active
January 15, 2017 16:38
-
-
Save adesmier/80c398f30a762810b8d40f484e2a9802 to your computer and use it in GitHub Desktop.
Codeship Rakefile to build Jekyll and push to BitBucket
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
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