Class: Chef::Resource::Deploy

Inherits:
Chef::Resource show all
Defined in:
lib/chef-deploy.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, collection = nil, node = nil) ⇒ Deploy

Returns a new instance of Deploy.



22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/chef-deploy.rb', line 22

def initialize(name, collection=nil, node=nil)
  super(name, collection, node)
  @resource_name = :deploy
  @deploy_to = name
  @branch = 'HEAD'
  @repository_cache = 'cached-copy'
  @copy_exclude = []
  @revision = nil
  @action = :deploy
  @allowed_actions.push(:deploy)
  @allowed_actions.push(:rollback)
end

Instance Method Details

#branch(arg = nil) ⇒ Object



132
133
134
135
136
137
138
# File 'lib/chef-deploy.rb', line 132

def branch(arg=nil)
  set_or_return(
    :branch,
    arg,
    :kind_of => [ String ]
  )
end

#copy_exclude(arg = nil) ⇒ Object



116
117
118
119
120
121
122
# File 'lib/chef-deploy.rb', line 116

def copy_exclude(arg=nil)
  set_or_return(
    :copy_exclude,
    arg,
    :kind_of => [ String ]
  )
end

#enable_submodules(arg = nil) ⇒ Object



92
93
94
95
96
97
98
# File 'lib/chef-deploy.rb', line 92

def enable_submodules(arg=nil)
  set_or_return(
    :enable_submodules,
    arg,
    :kind_of => [ TrueClass, FalseClass ]
  )
end

#environment(arg = nil) ⇒ Object



140
141
142
143
144
145
146
# File 'lib/chef-deploy.rb', line 140

def environment(arg=nil)
  set_or_return(
    :environment,
    arg,
    :kind_of => [ String ]
  )
end

#git_ssh_wrapper(arg = nil) ⇒ Object



148
149
150
151
152
153
154
# File 'lib/chef-deploy.rb', line 148

def git_ssh_wrapper(arg=nil)
  set_or_return(
    :git_ssh_wrapper,
    arg,
    :kind_of => [ String ]
  )
end

#group(arg = nil) ⇒ Object



84
85
86
87
88
89
90
# File 'lib/chef-deploy.rb', line 84

def group(arg=nil)
  set_or_return(
    :group,
    arg,
    :kind_of => [ String ]
  )
end

#migrate(arg = nil) ⇒ Object



60
61
62
63
64
65
66
# File 'lib/chef-deploy.rb', line 60

def migrate(arg=nil)
  set_or_return(
    :migrate,
    arg,
    :kind_of => [ TrueClass, FalseClass ]
  )
end

#migration_command(arg = nil) ⇒ Object



68
69
70
71
72
73
74
# File 'lib/chef-deploy.rb', line 68

def migration_command(arg=nil)
  set_or_return(
    :migration_command,
    arg,
    :kind_of => [ String ]
  )
end

#repo(arg = nil) ⇒ Object



35
36
37
38
39
40
41
# File 'lib/chef-deploy.rb', line 35

def repo(arg=nil)
  set_or_return(
    :repo,
    arg,
    :kind_of => [ String ]
  )
end

#repository_cache(arg = nil) ⇒ Object



108
109
110
111
112
113
114
# File 'lib/chef-deploy.rb', line 108

def repository_cache(arg=nil)
  set_or_return(
    :repository_cache,
    arg,
    :kind_of => [ String ]
  )
end

#restart_command(arg = nil) ⇒ Object



52
53
54
55
56
57
58
# File 'lib/chef-deploy.rb', line 52

def restart_command(arg=nil)
  set_or_return(
    :restart_command,
    arg,
    :kind_of => [ String ]
  )
end

#revision(arg = nil) ⇒ Object



124
125
126
127
128
129
130
# File 'lib/chef-deploy.rb', line 124

def revision(arg=nil)
  set_or_return(
    :revision,
    arg,
    :kind_of => [ String ]
  )
end

#role(arg = nil) ⇒ Object



44
45
46
47
48
49
50
# File 'lib/chef-deploy.rb', line 44

def role(arg=nil)
  set_or_return(
    :role,
    arg,
    :kind_of => [ String ]
  )
end

#scm(arg = nil) ⇒ Object



156
157
158
159
160
161
162
# File 'lib/chef-deploy.rb', line 156

def scm(arg=nil)
  set_or_return(
    :scm,
    arg,
    :kind_of => [ String ]
  )
end

#shallow_clone(arg = false) ⇒ Object



100
101
102
103
104
105
106
# File 'lib/chef-deploy.rb', line 100

def shallow_clone(arg=false)
  set_or_return(
    :shallow_clone,
    arg,
    :kind_of => [ TrueClass, FalseClass ]
  )
end

#svn_password(arg = nil) ⇒ Object



172
173
174
175
176
177
178
# File 'lib/chef-deploy.rb', line 172

def svn_password(arg=nil)
  set_or_return(
    :svn_password,
    arg,
    :kind_of => [ String ]
  )
end

#svn_username(arg = nil) ⇒ Object



164
165
166
167
168
169
170
# File 'lib/chef-deploy.rb', line 164

def svn_username(arg=nil)
  set_or_return(
    :svn_username,
    arg,
    :kind_of => [ String ]
  )
end

#user(arg = nil) ⇒ Object



76
77
78
79
80
81
82
# File 'lib/chef-deploy.rb', line 76

def user(arg=nil)
  set_or_return(
    :user,
    arg,
    :kind_of => [ String ]
  )
end