Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

chef-boneyard/railsconf2015-chef

Repository files navigation

Test-driving Your Rails Infrastructure with Chef

Managing your infrastructure with configuration management tools like Chef melds the practices of development and operations together. This workshop will focus on a development practice - Test Driven Development - and how that method can be applied to managing your Rails infrastructure and deployments. You will learn how to: Analyze your application and define your infrastructure needs (databases, load balancers, etc.), define unique infrastructure requirements for Rails applications (i.e. asset pipeline), capture your requirements in tests using Test Kitchen, ServerSpec, and other frameworks.

This workshop is being offered at RailsConf 2015.

Why are we here?

During the workshop we will provide an introduction to Infrastructure as Code and to Chef.

Participants of the workshop will complete hands-on labs that will practice test-driven infrastructure code development.

Our goal is to build the infrastructure required to run a basic Rails application.

NOTE: While we will be following a test-driven approach and the end result should work, we won't necessarily be following all of the best-practices for everything we build.

This Repository

The master branch is where we start. There are many other branches here that build on one another working toward a working example.

Infrastructure Requirements

The various requirements for our infrastructure include:

Ruby

Our application will use Ruby 2.2.2. We have created a debian package that targets our operating system (Ubuntu 12.04). The package was built with FPM using the build_ruby.sh script in this repository.

The following steps were taken to build the package:

  1. Provision an Ubuntu 12.04 instance on Amazon's EC2 using ami-00615068
  2. Run the build_ruby.sh script on that instance
  3. Publish the resulting debian package to s3 at - https://s3.amazonaws.com/chef-railsconf-2015/ruby-2.2.2_amd64.deb

Build a Widget World Ruby Cookbook.

Application Server

Our application will use Phusion Passenger for Apache. There may be other applications within our company that require Apache, but not Passenger. We will manage both components in individual cookbooks.

Build the following cookbooks:

RDBMS

Our application will use PostgreSQL version 9.1.

Build a Widget World PostgreSQL Cookbook.

Rails Application

Our Rails Application is available on GitHub. Deploy the initial release (v 0.0.1) of this application. This is the most advanced cookbook we'll create.

Build a Widget World Application Cookbook

About

Test-driving Your Rails Infrastructure with Chef

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published