Sha256: 692b8eb2278114a2d0fd29d61ac704310f4222253aa549ba8c70bed018893f8d

Contents?: true

Size: 683 Bytes

Versions: 12

Compression:

Stored size: 683 Bytes

Contents

desc 'capistrano COMMAND', 'Run a capistrano command on all deploy targets'
long_desc <<-LONGDESC
Example: `geordi capistrano deploy`
LONGDESC

def capistrano(*args)
  targets = Dir['config/deploy/*.rb'].map { |file| File.basename(file, '.rb') }.sort

  note 'Found the following deploy targets:'
  puts targets
  puts

  print 'Continue? [yN] '
  exit unless $stdin.gets =~ /[yes]+/

  targets << nil if targets.empty? # default target
  targets.each do |stage|
    announce 'Target: ' + (stage || '(default)')

    command = "bundle exec cap #{stage} " + args.join(' ')
    note_cmd command

    Util.system!(command, :fail_message => 'Capistrano failed. Have a look!')
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
geordi-1.2.3 lib/geordi/commands/capistrano.rb
geordi-1.2.2 lib/geordi/commands/capistrano.rb
geordi-1.2.1 lib/geordi/commands/capistrano.rb
geordi-1.2.0 lib/geordi/commands/capistrano.rb
geordi-1.1.4 lib/geordi/commands/capistrano.rb
geordi-1.1.3 lib/geordi/commands/capistrano.rb
geordi-1.1.2 lib/geordi/commands/capistrano.rb
geordi-1.1.1 lib/geordi/commands/capistrano.rb
geordi-1.1.0 lib/geordi/commands/capistrano.rb
geordi-1.0.3 lib/geordi/commands/capistrano.rb
geordi-1.0.2 lib/geordi/commands/capistrano.rb
geordi-1.0.1 lib/geordi/commands/capistrano.rb