Class: RightScale::DevRepository

Inherits:
Object
  • Object
show all
Includes:
Serializable
Defined in:
lib/right_agent/core_payload_types/dev_repository.rb

Overview

Sequence of cookbooks to be checked out on the instance.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Serializable

included

Constructor Details

#initialize(*args) ⇒ DevRepository

Initialize fields from given arguments



59
60
61
62
63
64
65
66
67
68
69
# File 'lib/right_agent/core_payload_types/dev_repository.rb', line 59

def initialize(*args)
  @repo_type              = args[0]
  @url                    = args[1] if args.size > 1
  @tag                    = args[2] if args.size > 2
  @cookbooks_path         = args[3] if args.size > 3
  @ssh_key                = args[4] if args.size > 4
  @username               = args[5] if args.size > 5
  @password               = args[6] if args.size > 6
  @repo_sha               = args[7] if args.size > 7
  @positions              = args[8] if args.size > 8
end

Instance Attribute Details

#cookbooks_pathObject

(Array) Path to cookbooks inside repostory Optional (use location of repository as cookbook path if nil)



43
44
45
# File 'lib/right_agent/core_payload_types/dev_repository.rb', line 43

def cookbooks_path
  @cookbooks_path
end

#passwordObject

(String) Password used to retrieve svn and raw repositories Optional, not used for git repositories.



52
53
54
# File 'lib/right_agent/core_payload_types/dev_repository.rb', line 52

def password
  @password
end

#positionsObject

(Array) List of cookbook <name, position> pairs



56
57
58
# File 'lib/right_agent/core_payload_types/dev_repository.rb', line 56

def positions
  @positions
end

#repo_shaObject

(String) hash of the CookbookSequence that corresponds to the repo



54
55
56
# File 'lib/right_agent/core_payload_types/dev_repository.rb', line 54

def repo_sha
  @repo_sha
end

#repo_typeObject

(Symbol) Type of repository: one of :git, :svn, :download or :local

  • :git denotes a ‘git’ repository that should be retrieved via ‘git clone’

  • :svn denotes a ‘svn’ repository that should be retrieved via ‘svn checkout’

  • :download denotes a tar ball that should be retrieved via HTTP GET (HTTPS if uri starts with https://)

  • :local denotes cookbook that is already local and doesn’t need to be retrieved



34
35
36
# File 'lib/right_agent/core_payload_types/dev_repository.rb', line 34

def repo_type
  @repo_type
end

#ssh_keyObject

(String) Private SSH key used to retrieve git repositories Optional, not used for svn and raw repositories.



46
47
48
# File 'lib/right_agent/core_payload_types/dev_repository.rb', line 46

def ssh_key
  @ssh_key
end

#tagObject

(String) git commit or svn branch that should be used to retrieve repository Optional, use ‘master’ for git and ‘trunk’ for svn if tag is nil. Not used for raw repositories.



40
41
42
# File 'lib/right_agent/core_payload_types/dev_repository.rb', line 40

def tag
  @tag
end

#urlObject

(String) URL to repository (e.g. git://github.com/opscode/chef-repo.git)



36
37
38
# File 'lib/right_agent/core_payload_types/dev_repository.rb', line 36

def url
  @url
end

#usernameObject

(String) Username used to retrieve svn and raw repositories Optional, not used for git repositories.



49
50
51
# File 'lib/right_agent/core_payload_types/dev_repository.rb', line 49

def username
  @username
end

Instance Method Details

#serialized_membersObject

Array of serialized fields given to constructor



72
73
74
# File 'lib/right_agent/core_payload_types/dev_repository.rb', line 72

def serialized_members
  [ @repo_type, @url, @tag, @cookbooks_path, @ssh_key, @username, @password, @repo_sha, @positions ]
end