-
Manual process is bad
-
Slow
-
Error prone
-
Makes releasing code hard
-
Automated process is good
This file contains hidden or 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
| % shef | |
| This is shef, the Chef shell. | |
| Chef Version: 0.10.8 | |
| http://www.opscode.com/chef | |
| http://wiki.opscode.com/display/chef/Home | |
| run `help' for help, `exit' or ^D to quit. | |
| chef > recipe |
This file contains hidden or 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
| namespace :ec2 do | |
| # setup chef config | |
| # | |
| config = File.join(File.dirname(__FILE__), '..', '.chef', 'knife.rb') | |
| Chef::Config.from_file(config) | |
| load_gem_or_report(%w{aws}) | |
| desc 'Delete any ec2-based chef nodes that no longer exist' | |
| task :cleanup_nodes do |
This file contains hidden or 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
| include Chef::Mixin::Command | |
| action :create do | |
| size = new_resource.size | |
| volumes = new_resource.volumes.times.map{|i| (i == 0 ? "/dev/sdf" : "/dev/sdf#{i}") } | |
| setra = new_resource.blockdev_setra | |
| volume_group = new_resource.volume_group | |
| logical_volume = new_resource.name | |
| mdadm_device = new_resource.mdadm_device | |
| mount_point = new_resource.mount_point |
This file contains hidden or 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
| sudo apt-get install libssl-dev | |
| sudo gem install fpm | |
| wget ftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.3-p392.tar.gz | |
| tar -zxvf ruby-1.9.3-p392.tar.gz | |
| cd src/ruby-1.9.3-p392 | |
| time (./configure --prefix=/usr && make && make install DESTDIR=/tmp/installdir) | |
| fpm -s dir -t deb -n ruby -v 1.9.3-p392 -C /tmp/installdir \ | |
| -p ruby-VERSION_ARCH.deb -d "libstdc++6 (>= 4.4.3)" \ |
This file contains hidden or 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
| def initialize(*args) | |
| super if defined?(super) | |
| @action = "deploy" | |
| end |
This file contains hidden or 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
| #! /usr/bin/ruby | |
| require 'chef/config' | |
| require 'chef/search/query' | |
| require 'chef/log' | |
| require 'time' | |
| require 'getoptlong' | |
| require "ohai" | |
| RET = { |
This file contains hidden or 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
| " Vim indent file | |
| " Language: CSS | |
| " Maintainer: Nikolai Weibull <now@bitwi.se> | |
| " Latest Revision: 2010-12-22 | |
| if exists("b:did_indent") | |
| finish | |
| endif | |
| let b:did_indent = 1 |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'chef' | |
| require 'chef/client' | |
| require 'chef/run_context' | |
| Chef::Config[:solo] = true | |
| Chef::Config[:log_level] = :info | |
| Chef::Log.level(:info) |
This file contains hidden or 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 'rubygems' | |
| require 'chef' | |
| require 'fog' | |
| require 'google_spreadsheet' | |
| Chef::Config.from_file("~/.chef/knife.rb") | |
| ec2 = Fog::AWS::EC2.new(:aws_access_key_id => ENV["AWS_KEY"], | |
| :aws_secret_access_key => ENV["AWS_SECRET"] ) |