Skip to content

Commit

Permalink
Violently upgrade to Capistrano 3.x
Browse files Browse the repository at this point in the history
Based on the great work by thoward in #54

This upgrade sacrifices some features:
* Writing output to a file
* Grouping log output by server
* Syntax checking
  • Loading branch information
pitluga committed Aug 22, 2014
2 parents 579c658 + 860eee4 commit 8aff487
Show file tree
Hide file tree
Showing 23 changed files with 220 additions and 418 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -2,3 +2,4 @@
*.gem
*.swp
**/*/puppet_output.txt
Gemfile.lock
2 changes: 1 addition & 1 deletion .ruby-version
@@ -1 +1 @@
1.9.3
2.0.0
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -3,3 +3,4 @@ rvm:
- 1.8.7
- 1.9.2
- 1.9.3
- 2.0.0
4 changes: 1 addition & 3 deletions Gemfile
@@ -1,6 +1,4 @@
source 'https://rubygems.org'

gem 'capistrano', '2.11.2'
gem 'vagrant', '0.9.7'
gem 'rake', '0.8.7'
gem 'rake', '>=10.0.0'
gem 'puppet', '2.7.1'
47 changes: 0 additions & 47 deletions Gemfile.lock

This file was deleted.

9 changes: 1 addition & 8 deletions README.md
Expand Up @@ -93,14 +93,6 @@ sets the maximum number of rsync commands that are run concurrently
when true, will syntax check your puppet files and erb templates before rsyncing them to your servers. This is an
experimental feature and is quite slow at the moment.

set :puppet_stream_output, false

will write the incremental output from the hosts to the screen instead of waiting until complete and printing by host.

set :puppet_write_to_file, nil

a file to additionally write puppet output to, useful for large noops with small scrollbacks.

set :puppet_runner, nil

allows you to specify the user to execute the puppet command as. Like running sudo -u puppet args from the command line.
Expand Down Expand Up @@ -136,6 +128,7 @@ If you write anything complicated, write a test for it. Test that your changes w
* Mike Pilat [mikepilat](https://github.com/mikepilat "github")
* Dan Manges [dan-manges](https://github.com/dan-manges "github") (one soda's worth)
* Brian Cosgrove [cosgroveb](https://github.com/cosgroveb "github")
* Troy Howard [thoward](https://github.com/thoward "github")

Copyright (c) 2012-2013 Tony Pitluga

Expand Down
23 changes: 2 additions & 21 deletions examples/vagrant/Capfile
@@ -1,21 +1,2 @@
# this is all to get vagrant working with capistrano
vagrant_gem = `gem which vagrant`.chomp
ssh_options[:keys] = File.expand_path('../../keys/vagrant', vagrant_gem)
ssh_options[:paranoid] = false
ssh_options[:keys_only] = true
ssh_options[:user_known_hosts_file] = []
ssh_options[:config] = false
set :user, 'vagrant'


$:.unshift File.expand_path('../../../lib', __FILE__) # in your Capfile, this would likely be "require 'rubygems'"
require 'supply_drop'

set :puppet_destination, "~/supply_drop"
set :puppet_command, "puppet"
set :puppet_stream_output, true
set :puppet_syntax_check, false
set :puppet_write_to_file, "puppet_output.txt"

server '33.33.33.10', :web, :app
role :db, '33.33.33.11', :nopuppet => true
require 'capistrano/setup'
require 'capistrano/deploy'
7 changes: 4 additions & 3 deletions examples/vagrant/Vagrantfile
@@ -1,7 +1,8 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant::Config.run do |config|
config.vm.box = "lucid32"
config.vm.box_url = "http://files.vagrantup.com/lucid32.box"
config.vm.define(:web) { |c| c.vm.network(:hostonly, "33.33.33.10") }
config.vm.define(:db) { |c| c.vm.network(:hostonly, "33.33.33.11") }
config.vm.network :hostonly, "33.33.33.10"
end

6 changes: 6 additions & 0 deletions examples/vagrant/config/deploy.rb
@@ -0,0 +1,6 @@
lock '3.2.1'

$:.unshift File.expand_path('../../../../lib', __FILE__) # in your Capfile, this would likely be "require 'rubygems'"
require 'supply_drop'

set :puppet_command, "puppet"
9 changes: 9 additions & 0 deletions examples/vagrant/config/deploy/staging.rb
@@ -0,0 +1,9 @@
set :ssh_options, {
keys: ["#{ENV['HOME']}/.vagrant.d/insecure_private_key"],
paranoid: false,
keys_only: true,
user_known_hosts_file: [],
# verbose: :debug,
config: false,
}
server '127.0.0.1', roles: %w(web app puppet), port: 2200, user: 'vagrant'
17 changes: 11 additions & 6 deletions lib/supply_drop.rb
@@ -1,12 +1,17 @@
require 'supply_drop/rsync'
require 'supply_drop/async_enumerable'
require 'supply_drop/plugin'
require 'supply_drop/syntax_checker'
require 'supply_drop/thread_pool'
require 'supply_drop/util'
require 'supply_drop/writer/batched'
require 'supply_drop/writer/file'
require 'supply_drop/writer/streaming'
require 'supply_drop/tasks'

Capistrano.plugin :supply_drop, SupplyDrop::Plugin
set :puppet_source, '.'
set :puppet_destination, '/var/tmp/supply_drop'
set :puppet_command, 'puppet apply'
set :puppet_lib, lambda { "#{fetch(:puppet_destination)}/modules" }
set :puppet_parameters, lambda { fetch(:puppet_verbose) ? '--debug --trace --color false puppet.pp' : '--color false puppet.pp' }
set :puppet_verbose, false
set :puppet_excludes, %w(.git .svn)
set :puppet_parallel_rsync, true
set :puppet_parallel_rsync_pool_size, 10
set :puppet_runner, nil
set :puppet_lock_file, '/tmp/puppet.lock'
96 changes: 0 additions & 96 deletions lib/supply_drop/plugin.rb

This file was deleted.

21 changes: 0 additions & 21 deletions lib/supply_drop/syntax_checker.rb

This file was deleted.

0 comments on commit 8aff487

Please sign in to comment.