Anti-Fragile Jekyll

This is my post-mortem on having a broken site live and was unable to fix it. In a clearer title:

Able to fix Jekyll sites anytime.

Granted the easiest thing I should have done was to save my stuff to VCS more regularly than I was. But this site is dedicated to automation so here is how I over-engineered my solution.

  1. Move VCS to Bitbucket
  2. Setup Bitbucket Pipeline for Deployments
  3. Solutions for Developing Anywhere

Moving to Bitbucket

This was easy since I had to run similar commands when my company changed the hostname for our Stash repositories. The reason for this over Github was the free private repos and mainly since I wanted to run some sort of build on it I would have to pay $60/month for Travis-Pro just to build my site, which at this point in time is a bit excessive.

  1. git remote -v Shows your current git remote URLs
  2. git remote add <name> <url> Adds a new remote repository, setting the name to origin will make the new url the new origin

Then run that first command to validate that it took.

Setup BitBucket Pipeline for Deployments

This took some research but there is a Docker container that has an environment prepped for BitBucket pipelines, there were a few issues when trying to use the generic ruby container that is built into Pipelines.

The rest was fairly straight forward.

Important Note: Spaces are the only whitespace allowed and it matters in the YAML file

image: maxttl/jekyll-for-bitbucket-pipelines:latest
clone:
  depth: 1    # only gets the latest version
pipelines:
  branches:
    master:
      - step:
        script:
          - gem install bundler # docker image needs bundler
          - bundle install      # install Gemfiles
          - jekyll build        # builds the site
          - octopress deploy    # deploys the site to S3

I know it seems weird that there is one step and then a massively long list of commands in the script area, but that is the only way it works currently.

Solutions for Developing Anywhere

This is where I started to go off of the rails looking for different solutions but ended up only at 2 solutions. Since these solutions are backups to the main workflow they do not need to be overkill.

Backups do not need to be overkill.

Mine kinda are.

Cloud 9

I have talked about Cloud 9 on here before but I now have it setup as a backup solution if my main machine ever goes offline again. Once Cloud 9 is connected to your BitBucket account it is a one click instance to create a VM in the cloud for yourself then run bundle install and voila you are ready to work. The biggest bonus is that you can setup the built in web browser in the Cloud 9 interface to show you work. Better yet since it is powered by Sauce Labs you can see your site in different web browsers and mobile devices as well.

Mobile Development

WHAT?!?!

Yeah you heard me. There are a couple of options here that you can work with.

CodeAnywhere

This is definitely more tailored to actual development than just working on a Jekyll website. But it is a workable solution on both iOS and Android devices.

Mr. Hyde

This is a fantastic Android app that allows for posts editing and previewing on mobile devices along with VCS integration. The VCS integration makes this work fantastically well with the Pipelines that was set up earlrier. Check it out on the Google Play Store here MrHyde

Andrew Krug's Picture

About Andrew Krug

Automation consultant helping you deliver greatness effectively.

New York, USA http://andrewmkrug.com

Comments