Sha256: dd097fb4ff8fe219a45ae279a5f9b78ebab8d0f68c1f8c886ed81b15f54e16d0

Contents?: true

Size: 1.52 KB

Versions: 27

Compression:

Stored size: 1.52 KB

Contents

module PoolParty    
  class Svn
        
    define_resource(:svn) do
      
      def has_svnpath(opts={})
        call_custom_function <<-EOE
        svnserve { #{opts[:name]}:
          source => "#{opts[:source]}",
          path => "#{opts[:path]}",
          user => "#{opts[:user] || false}",
          password => "#{opts[:password] || ""}"
        }
        EOE
      end
      
      custom_function <<-EOF
      # Serve subversion-based code from a local location.  The job of this
      # module is to check the data out from subversion and keep it up to
      # date, especially useful for providing data to your Puppet server.
      define svnserve($source, $path, $user = false, $password = false) {
          file { $path:
              ensure => directory,
              owner => root,
              group => root
          }
          $svncmd = $user ? {
              false => "/usr/bin/svn co --non-interactive $source/$name .",
              default => "/usr/bin/svn co --non-interactive --username $user --password '$password' $source/$name ."
          }   
          exec { "svnco-$name":
              command => $svncmd,
              cwd => $path,
              require => File[$path],
              creates => "$path/.svn"
          }
          exec { "svnupdate-$name":
              command => "/usr/bin/svn update",
              require => Exec["svnco-$name"],
              onlyif => '/usr/bin/svn status -u --non-interactive | /bin/grep "\*"',
              cwd => $path
          }
      }
      EOF
    end
    
  end
end

Version data entries

27 entries across 27 versions & 3 rubygems

Version Path
auser-poolparty-0.2.68 lib/poolparty/plugins/svn.rb
auser-poolparty-0.2.69 lib/poolparty/plugins/svn.rb
auser-poolparty-0.2.70 lib/poolparty/plugins/svn.rb
auser-poolparty-0.2.71 lib/poolparty/plugins/svn.rb
auser-poolparty-0.2.72 lib/poolparty/plugins/svn.rb
auser-poolparty-0.2.74 lib/poolparty/plugins/svn.rb
auser-poolparty-0.2.76 lib/poolparty/plugins/svn.rb
auser-poolparty-0.2.77 lib/poolparty/plugins/svn.rb
auser-poolparty-0.2.78 lib/poolparty/plugins/svn.rb
auser-poolparty-0.2.79 lib/poolparty/plugins/svn.rb
auser-poolparty-0.2.80 lib/poolparty/plugins/svn.rb
auser-poolparty-0.2.81 lib/poolparty/plugins/svn.rb
auser-poolparty-0.2.84 lib/poolparty/plugins/svn.rb
auser-poolparty-0.2.85 lib/poolparty/plugins/svn.rb
auser-poolparty-0.2.88 lib/poolparty/plugins/svn.rb
auser-poolparty-0.2.89 lib/poolparty/plugins/svn.rb
auser-poolparty-0.2.90 lib/poolparty/plugins/svn.rb
auser-poolparty-0.2.91 lib/poolparty/plugins/svn.rb
auser-poolparty-0.2.92 lib/poolparty/plugins/svn.rb
auser-poolparty-0.2.93 lib/poolparty/plugins/svn.rb