Sha256: b8e571772a32861a717bf675e4aa685fe5dbf80daaf29f48e32c4e2c09e9f4f2

Contents?: true

Size: 682 Bytes

Versions: 3

Compression:

Stored size: 682 Bytes

Contents

#!/usr/bin/env ruby

# Ruby 1.9 doesn't include the current
# working directory on the load path.
$: << Dir.pwd + '/lib/'

# Automatically sucks in the `sshkit`
# files so that you don't need to.
require 'sshkit/dsl'

directory = '/opt/sites/web_application'
hosts     = SSHKit::Host.new("root@example.com")

SSHKit.config.output = SSHKit::Formatter::Pretty.new($stdout)

on hosts do |host|
  target = '/opt/rack-rack-repository'
  if host.hostname =~ /seven/
    target = '/var/rack-rack-repository'
  end
  if execute(:test, "-d #{target}")
    within target do
      execute :git, :pull
    end
  else
    execute :git, :clone, 'git://github.com/rack/rack.git', target
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sshkit-0.0.4 example.rb
sshkit-0.0.3 example.rb
sshkit-0.0.2 example.rb