The Occasion
I heard of Octopress before but never had the reason or the time to look into it until now. After several interesting e-mail and phonecall exchanges w/ a past designer partner and a long-standing client regarding NDA’s, non-compete agreement, and their fear of losing sensitive business info/technology to competitors, I agreed to pull down their info from my portfolio site–I was in no violation of any NDA’s or non-compete’s or any professional ethics but given their bad experience in the past with other contractors and employees, I could see their concern and I acquiesced. Besides, I’ve been wanting to update my site for a while now and convert it into more of a blog than a portfolio site, so this gave me just the push I needed to move forward w/ this change.
The Timing
And the timing couldn’t have been any better. Today I stumbled across a popular javascript podcast called YayQuery hosted by four developers including Paul Irish (the lead developer behind Modernizr and HTML5 Boilerplate and a jQuery team member). While I was working on some frontend development, I listened to their latest podcast (Episode 23) and what do you know? Rebecca Murphey (one of the four) raved about Octopress and how she’d pay the creator if she could. So I decided after the wife went down for the night to give it a spin and I was thoroughly impressed.
The Experience
Octopress is a framework for Jekyll (if you’re interested in Jekyll, checkout the bootstrap). I had played around with Jekyll before but found it a little too manual. A quick read through the Octopress intro piqued even further my interest (BTW, their documentation is excellent). So, after 20 minutes of setup (had pub key issues to resolve, hence the title “… or Less”), i.e., something like…
# several assumptions:
# 1) rvm installed w/ ruby 1.9.2
# 2) git installed
# 3) existing heroku account
git clone git://github.com/imathis/octopress.git octopress
cd octopress
rvm use 1.9.2
rvm gemset create octopress
rvm use 1.9.2@octopress
echo "rvm use 1.9.2@octopress" > ./.rvmrc
gem install bundle
bundle install
rake install
gem install heroku
heroku create
git config branch.master.remote heroku
git add .
git commit -m 'site updated'
git push heroku master
there I was deploying via heroku to the www w/ a pretty slick looking blog.
The Blog
So, I decided, my first blog entry should be on… what else? Octopress. Folks, this thing rocks! It’s definitely not for everyone… lots of other great outfits for the non-technical–word press, blogger, tumblr, et. al. But if you know your way around the UNIX terminal and basic git (and markdown a plus), this is definitely for you. It was @ 11:05 PM that I opened up my laptop tonight, pointed my browser to http://octopress.org. By the time I got Octopress up and running on Heroku, typed up my first blog entry and rake generate and git push up to heroku to publish to the www it was 11:55 PM. 50 minutes flat. Kudos to Octopress and Heroku!
To edit and preview the blog locally:
# the following will generate
# source/_posts/2012-01-19-octopress-zero-to-deploy-in-20-minutes-or-less.markdown
# which is the blog entry you edit.
# your slug will be your file name, more or less. if you don't like it,
# you can always change it later by changing the file name.
rake new_post["Octopress Zero to Deploy in 20 Minutes or Less"]
# to view your blog @http://localhost:4000/
rake preview
# once everything looks good, deploy to Heroku per above.
The Deployment
… It’s been a few days, and I decided to deploy this to one of my rackspace cloud servers. Why? What happened to the “Kudos to Heroku!”? Heroku makes it dead simple to deploy and hats off to them for that, but Heroku is slow… well, on a free instance, at least. If the site hasn’t been visited in a while, Heroku unloads my instance from memory. No big deal. I already have Nginx up and running on a cloud server. After a little rsync magic and updating Nginx conf, voila! Octopress is now live and kicking on rackspace cloud.
Oh, and don’t forget the one line shell command to deploy.
rake generate && rake deploy