Permalink
Browse files

Initial commit

  • Loading branch information...
iain committed Sep 10, 2011
0 parents commit 895a3a345d25f7349b74304e71523b473eabb7e0
Showing with 488 additions and 0 deletions.
  1. +4 −0 .gitignore
  2. +55 −0 .rvmrc
  3. +4 −0 Gemfile
  4. +62 −0 README.md
  5. +1 −0 Rakefile
  6. +24 −0 capistrano_chef_solo.gemspec
  7. +335 −0 lib/capistrano_chef_solo.rb
  8. +3 −0 lib/capistrano_chef_solo/version.rb
@@ -0,0 +1,4 @@
+*.gem
+.bundle
+Gemfile.lock
+pkg/*
55 .rvmrc
@@ -0,0 +1,55 @@
+#!/usr/bin/env bash
+
+# This is an RVM Project .rvmrc file, used to automatically load the ruby
+# development environment upon cd'ing into the directory
+
+# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional.
+environment_id="ruby-1.9.2-p290@capistrano_chef_solo"
+
+#
+# Uncomment following line if you want options to be set only for given project.
+#
+# PROJECT_JRUBY_OPTS=( --1.9 )
+
+#
+# First we attempt to load the desired environment directly from the environment
+# file. This is very fast and efficient compared to running through the entire
+# CLI and selector. If you want feedback on which environment was used then
+# insert the word 'use' after --create as this triggers verbose mode.
+#
+if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \
+ && -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
+then
+ \. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
+
+ if [[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]]
+ then
+ . "${rvm_path:-$HOME/.rvm}/hooks/after_use"
+ fi
+else
+ # If the environment file has not yet been created, use the RVM CLI to select.
+ if ! rvm --create "$environment_id"
+ then
+ echo "Failed to create RVM environment '${environment_id}'."
+ exit 1
+ fi
+fi
+
+#
+# If you use an RVM gemset file to install a list of gems (*.gems), you can have
+# it be automatically loaded. Uncomment the following and adjust the filename if
+# necessary.
+#
+# filename=".gems"
+# if [[ -s "$filename" ]]
+# then
+# rvm gemset import "$filename" | grep -v already | grep -v listed | grep -v complete | sed '/^$/d'
+# fi
+
+# If you use bundler, this might be useful to you:
+# if command -v bundle && [[ -s Gemfile ]]
+# then
+# bundle
+# fi
+
+
@@ -0,0 +1,4 @@
+source "http://rubygems.org"
+
+# Specify your gem's dependencies in capistrano_chef_solo.gemspec
+gemspec
@@ -0,0 +1,62 @@
+# Capistrano Chef-solo
+
+This is an attempt to combine the powers of [Capistrano](http://capify.org) and
+[chef-solo](http://wiki.opscode.com/display/chef/Chef+Solo).
+
+You can easily specify run lists:
+
+ before "deploy" do
+ chef.solo "recipe[foo]", "recipe[bar]"
+ end
+
+And set some node attributes:
+
+ set :chef_attributes, :foo => { :bar => "baz" }
+
+Cookbooks will be automatically be copied from `config/cookbooks` and `vendor/cookbooks`.
+
+Then an empty VM can be installed, configured and deployed in one single command:
+
+ cap deploy
+
+## Installation
+
+Add to your `Gemfile`:
+
+ gem 'capistrano_chef_solo', :require => false, :group => :development
+
+And run `bundle install`.
+
+Next, require me from your `Capfile`:
+
+ require 'capistrano_chef_solo'
+
+## Usage
+
+Read the full documentation by typing:
+
+ cap --explain chef | less
+
+## Note
+
+This gem is in very early stage of development and should be considered as just a spike at this
+moment. Feel free to use it, and give me feedback on your experiences. But please, try it out on
+a simple VM first.
+
+## Todo
+
+* Support roles in both Capistrano and Chef.
+
+## Tips
+
+### Colors
+
+Capistrano and chef both give a lot of output. It helps to install
+[capistrano_colors](https://github.com/stjernstrom/capistrano_colors)
+
+### Vagrant
+
+Using [Vagrant](http://vagrantup.com) is a good way for testing out chef recipes.
+
+---
+Copyright Iain Hecker, 2011. Released under the MIT License.
@@ -0,0 +1 @@
+require "bundler/gem_tasks"
@@ -0,0 +1,24 @@
+# -*- encoding: utf-8 -*-
+$:.push File.expand_path("../lib", __FILE__)
+require "capistrano_chef_solo/version"
+
+Gem::Specification.new do |s|
+ s.name = "capistrano_chef_solo"
+ s.version = CapistranoChefSolo::VERSION
+ s.authors = ["iain"]
+ s.email = ["iain@iain.nl"]
+ s.homepage = ""
+ s.summary = %q{Combining the awesome powers of Capistrano and chef-solo}
+ s.description = %q{This gem provides Capistrano tasks to run chef-solo with Capistrano, with hardly any configuration needed.}
+
+ s.rubyforge_project = "capistrano_chef_solo"
+
+ s.files = `git ls-files`.split("\n")
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+ s.require_paths = ["lib"]
+
+ # specify any dependencies here; for example:
+ # s.add_development_dependency "rspec"
+ s.add_runtime_dependency "capistrano", "~> 2.8.0"
+end
Oops, something went wrong.

0 comments on commit 895a3a3

Please sign in to comment.