Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 338 lines (291 sloc) 11.102 kb
887b3db @adelcambre Refactor deployment
adelcambre authored
1 # stolen wholesale from capistrano, thanks Jamis!
427b315 @smerritt Bundle with the user's particular bundler version.
smerritt authored
2 require 'base64'
887b3db @adelcambre Refactor deployment
adelcambre authored
3 require 'fileutils'
4 require 'json'
5
6 module EY
2f42987 @adelcambre OMG Huge patch
adelcambre authored
7 class DeployBase < Task
0ffe959 @smerritt Ensure that informational messages go to the log.
smerritt authored
8 include LoggedOutput
9
79dad04 @adelcambre Move to cap style deployment
adelcambre authored
10 # default task
887b3db @adelcambre Refactor deployment
adelcambre authored
11 def deploy
5bc9080 @smerritt Put timestamps in the deploy log. [#168]
smerritt authored
12 debug "Starting deploy at #{Time.now.asctime}"
79dad04 @adelcambre Move to cap style deployment
adelcambre authored
13 update_repository_cache
3993036 @martinemde Added integrate task to engineyard-serverside.
martinemde authored
14 cached_deploy
15 end
16
17 def cached_deploy
18 debug "Deploying app from cached copy at #{Time.now.asctime}"
79dad04 @adelcambre Move to cap style deployment
adelcambre authored
19 require_custom_tasks
20 push_code
21
0ffe959 @smerritt Ensure that informational messages go to the log.
smerritt authored
22 info "~> Starting full deploy"
2f42987 @adelcambre OMG Huge patch
adelcambre authored
23 copy_repository_cache
682a906 @smerritt Run all the hooks on all the instances.
smerritt authored
24
1b0c6f6 @larrytheliquid [#4] Cleanup latest release on deploy failures
larrytheliquid authored
25 with_failed_release_cleanup do
26 create_revision_file
27 bundle
28 symlink_configs
4314be0 @adelcambre If the enable_maintenance_page task is called, just do it
adelcambre authored
29 conditionally_enable_maintenance_page
267621d @martinemde Enable maintenance page for rollbacks
martinemde authored
30 run_with_callbacks(:migrate)
1b0c6f6 @larrytheliquid [#4] Cleanup latest release on deploy failures
larrytheliquid authored
31 callback(:before_symlink)
32 symlink
267621d @martinemde Enable maintenance page for rollbacks
martinemde authored
33 end
682a906 @smerritt Run all the hooks on all the instances.
smerritt authored
34
1b0c6f6 @larrytheliquid [#4] Cleanup latest release on deploy failures
larrytheliquid authored
35 callback(:after_symlink)
36 run_with_callbacks(:restart)
37 disable_maintenance_page
38
39 cleanup_old_releases
5bc9080 @smerritt Put timestamps in the deploy log. [#168]
smerritt authored
40 debug "Finished deploy at #{Time.now.asctime}"
1b0c6f6 @larrytheliquid [#4] Cleanup latest release on deploy failures
larrytheliquid authored
41 rescue Exception
5bc9080 @smerritt Put timestamps in the deploy log. [#168]
smerritt authored
42 debug "Finished failing to deploy at #{Time.now.asctime}"
1b0c6f6 @larrytheliquid [#4] Cleanup latest release on deploy failures
larrytheliquid authored
43 puts_deploy_failure
44 raise
887b3db @adelcambre Refactor deployment
adelcambre authored
45 end
46
c95d174 @smerritt Add 'restart' task to restart app servers.
smerritt authored
47 def restart_with_maintenance_page
48 require_custom_tasks
49 conditionally_enable_maintenance_page
50 restart
51 disable_maintenance_page
52 end
53
6f96588 @martinemde Rename install/remove_maintenance_page -> enable/disable_...
martinemde authored
54 def enable_maintenance_page
fe9c8cb @smerritt Put up a default maintenance page if the app doesn't have one.
smerritt authored
55 maintenance_page_candidates = [
56 "public/maintenance.html.custom",
57 "public/maintenance.html.tmp",
58 "public/maintenance.html",
59 "public/system/maintenance.html.default",
60 ].map do |file|
32dc1ce @larrytheliquid Use latest_release for enabling maintenance page.
larrytheliquid authored
61 File.join(c.latest_release, file)
fe9c8cb @smerritt Put up a default maintenance page if the app doesn't have one.
smerritt authored
62 end
63
64 # this one is guaranteed to exist
65 maintenance_page_candidates << File.expand_path(
66 "default_maintenance_page.html",
67 File.dirname(__FILE__)
68 )
69
4314be0 @adelcambre If the enable_maintenance_page task is called, just do it
adelcambre authored
70 # put in the maintenance page
fe9c8cb @smerritt Put up a default maintenance page if the app doesn't have one.
smerritt authored
71 maintenance_file = maintenance_page_candidates.detect do |file|
72 File.exists?(file)
4314be0 @adelcambre If the enable_maintenance_page task is called, just do it
adelcambre authored
73 end
f9d903f Put a maintenance page up if there is one, and you are running migration...
Wesley Beary & Andy Delcambre authored
74
fe9c8cb @smerritt Put up a default maintenance page if the app doesn't have one.
smerritt authored
75 @maintenance_up = true
76 roles :app_master, :app, :solo do
a5c142f @smerritt Install binstubs + have them in $PATH when migrating
smerritt authored
77 maint_page_dir = File.join(c.shared_path, "system")
78 visible_maint_page = File.join(maint_page_dir, "maintenance.html")
79 run Escape.shell_command(['mkdir', '-p', maint_page_dir])
80 run Escape.shell_command(['cp', maintenance_file, visible_maint_page])
f9d903f Put a maintenance page up if there is one, and you are running migration...
Wesley Beary & Andy Delcambre authored
81 end
82 end
83
4314be0 @adelcambre If the enable_maintenance_page task is called, just do it
adelcambre authored
84 def conditionally_enable_maintenance_page
85 if c.migrate? || c.stack == "nginx_mongrel"
86 enable_maintenance_page
87 end
88 end
89
6f96588 @martinemde Rename install/remove_maintenance_page -> enable/disable_...
martinemde authored
90 def disable_maintenance_page
1b0c6f6 @larrytheliquid [#4] Cleanup latest release on deploy failures
larrytheliquid authored
91 @maintenance_up = false
f9d903f Put a maintenance page up if there is one, and you are running migration...
Wesley Beary & Andy Delcambre authored
92 roles :app_master, :app, :solo do
93 run "rm -f #{File.join(c.shared_path, "system", "maintenance.html")}"
94 end
95 end
96
4848f16 @larrytheliquid [#226] Rollback cleans up proper directory
larrytheliquid authored
97 def run_with_callbacks(task)
8ea0612 @adelcambre Make rollback rebundle.
adelcambre authored
98 callback(:"before_#{task}")
4848f16 @larrytheliquid [#226] Rollback cleans up proper directory
larrytheliquid authored
99 send(task)
8ea0612 @adelcambre Make rollback rebundle.
adelcambre authored
100 callback(:"after_#{task}")
101 end
102
79dad04 @adelcambre Move to cap style deployment
adelcambre authored
103 # task
104 def push_code
0ffe959 @smerritt Ensure that informational messages go to the log.
smerritt authored
105 info "~> Pushing code to all servers"
65b3d1a @larrytheliquid [#11] Make command executed across all servers happen in parallel
larrytheliquid authored
106 barrier *(EY::Server.all.map do |server|
3993036 @martinemde Added integrate task to engineyard-serverside.
martinemde authored
107 need_later { server.sync_directory(config.repository_cache) }
65b3d1a @larrytheliquid [#11] Make command executed across all servers happen in parallel
larrytheliquid authored
108 end)
d34ab91 @adelcambre Implement eysd update
adelcambre authored
109 end
110
887b3db @adelcambre Refactor deployment
adelcambre authored
111 # task
112 def restart
1b0c6f6 @larrytheliquid [#4] Cleanup latest release on deploy failures
larrytheliquid authored
113 @restart_failed = true
0ffe959 @smerritt Ensure that informational messages go to the log.
smerritt authored
114 info "~> Restarting app servers"
79dad04 @adelcambre Move to cap style deployment
adelcambre authored
115 roles :app_master, :app, :solo do
116 restart_command = case c.stack
117 when "nginx_unicorn"
ed29e32 @larrytheliquid [#137] Don't try to clean up old unicorn pid if it doesn't exist
larrytheliquid authored
118 pidfile = "/var/run/engineyard/unicorn_#{c.app}.pid"
119 condition = "[ -e #{pidfile} ] && [ ! -d /proc/`cat #{pidfile}` ]"
21c4208 - I think this does it.
Scott M. Likens authored
120 run("if #{condition}; then rm -f #{pidfile}; fi")
121 run("/engineyard/bin/app_#{c.app} deploy")
79dad04 @adelcambre Move to cap style deployment
adelcambre authored
122 when "nginx_mongrel"
f3ef085 @indirect Link mongrel_cluster.yml so mongrels can start
indirect authored
123 sudo("monit restart all -g #{c.app}")
848216b @smerritt Die loudly when restarting an unknown web server stack.
smerritt authored
124 when "nginx_passenger"
21c4208 - I think this does it.
Scott M. Likens authored
125 run("touch #{c.current_path}/tmp/restart.txt")
848216b @smerritt Die loudly when restarting an unknown web server stack.
smerritt authored
126 else
127 raise "Unknown stack #{c.stack}; restart failed!"
79dad04 @adelcambre Move to cap style deployment
adelcambre authored
128 end
887b3db @adelcambre Refactor deployment
adelcambre authored
129 end
1b0c6f6 @larrytheliquid [#4] Cleanup latest release on deploy failures
larrytheliquid authored
130 @restart_failed = false
887b3db @adelcambre Refactor deployment
adelcambre authored
131 end
132
133 # task
134 def bundle
f99486e @adelcambre Don't use latest_release for anything in deployment
adelcambre authored
135 if File.exist?("#{c.release_path}/Gemfile")
0ffe959 @smerritt Ensure that informational messages go to the log.
smerritt authored
136 info "~> Gemfile detected, bundling gems"
f99486e @adelcambre Don't use latest_release for anything in deployment
adelcambre authored
137 lockfile = File.join(c.release_path, "Gemfile.lock")
427b315 @smerritt Bundle with the user's particular bundler version.
smerritt authored
138
696befc @smerritt Use bundler 1.0.0.rc.2 as default 1.0-series bundler.
smerritt authored
139 bundler_installer = if File.exist?(lockfile)
140 get_bundler_installer(lockfile)
141 else
142 warn_about_missing_lockfile
c6d507b @smerritt Use bundler 1.0.0 as default 1.0-series bundler.
smerritt authored
143 bundler_09_installer(default_09_bundler)
696befc @smerritt Use bundler 1.0.0.rc.2 as default 1.0-series bundler.
smerritt authored
144 end
427b315 @smerritt Bundle with the user's particular bundler version.
smerritt authored
145
696befc @smerritt Use bundler 1.0.0.rc.2 as default 1.0-series bundler.
smerritt authored
146 sudo "#{$0} _#{VERSION}_ install_bundler #{bundler_installer.version}"
427b315 @smerritt Bundle with the user's particular bundler version.
smerritt authored
147
696befc @smerritt Use bundler 1.0.0.rc.2 as default 1.0-series bundler.
smerritt authored
148 run "cd #{c.release_path} && bundle _#{bundler_installer.version}_ install #{bundler_installer.options}"
887b3db @adelcambre Refactor deployment
adelcambre authored
149 end
150 end
151
152 # task
1b0c6f6 @larrytheliquid [#4] Cleanup latest release on deploy failures
larrytheliquid authored
153 def cleanup_old_releases
154 @cleanup_failed = true
0ffe959 @smerritt Ensure that informational messages go to the log.
smerritt authored
155 info "~> Cleaning up old releases"
066cefd @adelcambre Clean up old releases on each instance, not just based on the master's r...
adelcambre authored
156 sudo "ls #{c.release_dir} | head -n -3 | xargs -I{} rm -rf #{c.release_dir}/{}"
1b0c6f6 @larrytheliquid [#4] Cleanup latest release on deploy failures
larrytheliquid authored
157 @cleanup_failed = false
887b3db @adelcambre Refactor deployment
adelcambre authored
158 end
159
160 # task
161 def rollback
8337a92 @adelcambre Don't rollback beyond the oldest release
adelcambre authored
162 if c.all_releases.size > 1
4848f16 @larrytheliquid [#226] Rollback cleans up proper directory
larrytheliquid authored
163 rolled_back_release = c.latest_release
164 c.release_path = c.previous_release(rolled_back_release)
570d606 @smerritt Show commit message for rollbacks.
smerritt authored
165
166 revision = File.read(File.join(c.release_path, 'REVISION')).strip
0ffe959 @smerritt Ensure that informational messages go to the log.
smerritt authored
167 info "~> Rolling back to previous release: #{short_log_message(revision)}"
570d606 @smerritt Show commit message for rollbacks.
smerritt authored
168
4848f16 @larrytheliquid [#226] Rollback cleans up proper directory
larrytheliquid authored
169 run_with_callbacks(:symlink)
170 sudo "rm -rf #{rolled_back_release}"
8337a92 @adelcambre Don't rollback beyond the oldest release
adelcambre authored
171 bundle
0ffe959 @smerritt Ensure that informational messages go to the log.
smerritt authored
172 info "~> Restarting with previous release"
8337a92 @adelcambre Don't rollback beyond the oldest release
adelcambre authored
173 with_maintenance_page { run_with_callbacks(:restart) }
174 else
0ffe959 @smerritt Ensure that informational messages go to the log.
smerritt authored
175 info "~> Already at oldest release, nothing to roll back to"
8337a92 @adelcambre Don't rollback beyond the oldest release
adelcambre authored
176 exit(1)
177 end
887b3db @adelcambre Refactor deployment
adelcambre authored
178 end
179
180 # task
181 def migrate
1b0c6f6 @larrytheliquid [#4] Cleanup latest release on deploy failures
larrytheliquid authored
182 return unless c.migrate?
183 @migrations_reached = true
79dad04 @adelcambre Move to cap style deployment
adelcambre authored
184 roles :app_master, :solo do
a5c142f @smerritt Install binstubs + have them in $PATH when migrating
smerritt authored
185 cmd = "cd #{c.release_path} && PATH=#{c.binstubs_path}:$PATH #{c.framework_envs} #{c.migration_command}"
0ffe959 @smerritt Ensure that informational messages go to the log.
smerritt authored
186 info "~> Migrating: #{cmd}"
1b0c6f6 @larrytheliquid [#4] Cleanup latest release on deploy failures
larrytheliquid authored
187 run(cmd)
887b3db @adelcambre Refactor deployment
adelcambre authored
188 end
189 end
190
2f42987 @adelcambre OMG Huge patch
adelcambre authored
191 # task
192 def copy_repository_cache
0ffe959 @smerritt Ensure that informational messages go to the log.
smerritt authored
193 info "~> Copying to #{c.release_path}"
6fc08fe - More sudo love.
Scott M. Likens authored
194 run("mkdir -p #{c.release_path} && rsync -aq #{c.exclusions} #{c.repository_cache}/ #{c.release_path}")
887b3db @adelcambre Refactor deployment
adelcambre authored
195
0ffe959 @smerritt Ensure that informational messages go to the log.
smerritt authored
196 info "~> Ensuring proper ownership"
2f42987 @adelcambre OMG Huge patch
adelcambre authored
197 sudo("chown -R #{c.user}:#{c.group} #{c.deploy_to}")
887b3db @adelcambre Refactor deployment
adelcambre authored
198 end
199
235ff4f @smerritt Create REVISION on all app servers. [#169]
smerritt authored
200 def create_revision_file
201 run create_revision_file_command
202 end
203
f99486e @adelcambre Don't use latest_release for anything in deployment
adelcambre authored
204 def symlink_configs(release_to_link=c.release_path)
0ffe959 @smerritt Ensure that informational messages go to the log.
smerritt authored
205 info "~> Symlinking configs"
8e5fac3 @smerritt Symlink newrelic.yml if it exists.
smerritt authored
206 [ "chmod -R g+w #{release_to_link}",
c846183 @adelcambre Clean up deploy tasks a bit
adelcambre authored
207 "rm -rf #{release_to_link}/log #{release_to_link}/public/system #{release_to_link}/tmp/pids",
208 "mkdir -p #{release_to_link}/tmp",
209 "ln -nfs #{c.shared_path}/log #{release_to_link}/log",
210 "mkdir -p #{release_to_link}/public",
211 "mkdir -p #{release_to_link}/config",
212 "ln -nfs #{c.shared_path}/system #{release_to_link}/public/system",
213 "ln -nfs #{c.shared_path}/pids #{release_to_link}/tmp/pids",
214 "ln -nfs #{c.shared_path}/config/database.yml #{release_to_link}/config/database.yml",
f3ef085 @indirect Link mongrel_cluster.yml so mongrels can start
indirect authored
215 "ln -nfs #{c.shared_path}/config/mongrel_cluster.yml #{release_to_link}/config/mongrel_cluster.yml",
8e5fac3 @smerritt Symlink newrelic.yml if it exists.
smerritt authored
216 ].each do |cmd|
6fc08fe - More sudo love.
Scott M. Likens authored
217 run cmd
8e5fac3 @smerritt Symlink newrelic.yml if it exists.
smerritt authored
218 end
61ac5f2 @martinemde Make sure "chown deploy" runs as root, not deploy.
martinemde authored
219
220 sudo "chown -R #{c.user}:#{c.group} #{release_to_link}"
221 run "if [ -f \"#{c.shared_path}/config/newrelic.yml\" ]; then ln -nfs #{c.shared_path}/config/newrelic.yml #{release_to_link}/config/newrelic.yml; fi"
c846183 @adelcambre Clean up deploy tasks a bit
adelcambre authored
222 end
223
2f42987 @adelcambre OMG Huge patch
adelcambre authored
224 # task
f99486e @adelcambre Don't use latest_release for anything in deployment
adelcambre authored
225 def symlink(release_to_link=c.release_path)
0ffe959 @smerritt Ensure that informational messages go to the log.
smerritt authored
226 info "~> Symlinking code"
6fc08fe - More sudo love.
Scott M. Likens authored
227 run "rm -f #{c.current_path} && ln -nfs #{release_to_link} #{c.current_path} && chown -R #{c.user}:#{c.group} #{c.current_path}"
1b0c6f6 @larrytheliquid [#4] Cleanup latest release on deploy failures
larrytheliquid authored
228 @symlink_changed = true
229 rescue Exception
230 sudo "rm -f #{c.current_path} && ln -nfs #{c.previous_release(release_to_link)} #{c.current_path} && chown -R #{c.user}:#{c.group} #{c.current_path}"
231 @symlink_changed = false
232 raise
887b3db @adelcambre Refactor deployment
adelcambre authored
233 end
234
682a906 @smerritt Run all the hooks on all the instances.
smerritt authored
235 def callback(what)
1b0c6f6 @larrytheliquid [#4] Cleanup latest release on deploy failures
larrytheliquid authored
236 @callbacks_reached ||= true
790ab3e @smerritt fix typo introduced in c2c25c75
smerritt authored
237 if File.exist?("#{c.release_path}/deploy/#{what}.rb")
d02aa70 @adelcambre Calling #migrate? in deploy hooks works [#165]
adelcambre authored
238 base_command = [$0, "_#{VERSION}_", 'hook', what.to_s,
239 '--app', config.app.to_s,
240 '--release-path', config.release_path.to_s,
241 ]
242
243 run Escape.shell_command(base_command) do |server, cmd|
244 per_instance_args = [
245 '--framework-env', c.environment.to_s,
fe64a15 @outerim Make deploy hooks work with multiple roles
outerim authored
246 '--current-roles', server.roles.join(' '),
d02aa70 @adelcambre Calling #migrate? in deploy hooks works [#165]
adelcambre authored
247 '--config', c.to_json,
248 ]
249 per_instance_args << '--current-name' << server.name.to_s if server.name
250 cmd << " " << Escape.shell_command(per_instance_args)
d7cfbba @smerritt Tell deploy hooks what their name and role is.
smerritt authored
251 end
887b3db @adelcambre Refactor deployment
adelcambre authored
252 end
253 end
267621d @martinemde Enable maintenance page for rollbacks
martinemde authored
254
255 protected
256
1b0c6f6 @larrytheliquid [#4] Cleanup latest release on deploy failures
larrytheliquid authored
257 def puts_deploy_failure
258 if @cleanup_failed
0ffe959 @smerritt Ensure that informational messages go to the log.
smerritt authored
259 info "~> [Relax] Your site is running new code, but cleaning up old deploys failed"
1b0c6f6 @larrytheliquid [#4] Cleanup latest release on deploy failures
larrytheliquid authored
260 elsif @maintenance_up
0ffe959 @smerritt Ensure that informational messages go to the log.
smerritt authored
261 info "~> [Attention] Maintenance page still up, consider the following before removing:"
262 info " * any deploy hooks ran, be careful if they were destructive" if @callbacks_reached
263 info " * any migrations ran, be careful if they were destructive" if @migrations_reached
1b0c6f6 @larrytheliquid [#4] Cleanup latest release on deploy failures
larrytheliquid authored
264 if @symlink_changed
0ffe959 @smerritt Ensure that informational messages go to the log.
smerritt authored
265 info " * your new code is symlinked as current"
1b0c6f6 @larrytheliquid [#4] Cleanup latest release on deploy failures
larrytheliquid authored
266 else
0ffe959 @smerritt Ensure that informational messages go to the log.
smerritt authored
267 info " * your old code is still symlinked as current"
1b0c6f6 @larrytheliquid [#4] Cleanup latest release on deploy failures
larrytheliquid authored
268 end
0ffe959 @smerritt Ensure that informational messages go to the log.
smerritt authored
269 info " * application servers failed to restart" if @restart_failed
1b0c6f6 @larrytheliquid [#4] Cleanup latest release on deploy failures
larrytheliquid authored
270 else
0ffe959 @smerritt Ensure that informational messages go to the log.
smerritt authored
271 info "~> [Relax] Your site is still running old code and nothing destructive could have occurred"
1b0c6f6 @larrytheliquid [#4] Cleanup latest release on deploy failures
larrytheliquid authored
272 end
273 end
274
267621d @martinemde Enable maintenance page for rollbacks
martinemde authored
275 def with_maintenance_page
4314be0 @adelcambre If the enable_maintenance_page task is called, just do it
adelcambre authored
276 conditionally_enable_maintenance_page
267621d @martinemde Enable maintenance page for rollbacks
martinemde authored
277 yield if block_given?
278 disable_maintenance_page
279 end
1b0c6f6 @larrytheliquid [#4] Cleanup latest release on deploy failures
larrytheliquid authored
280
281 def with_failed_release_cleanup
282 yield
283 rescue Exception
f99486e @adelcambre Don't use latest_release for anything in deployment
adelcambre authored
284 sudo "rm -rf #{c.release_path}"
4848f16 @larrytheliquid [#226] Rollback cleans up proper directory
larrytheliquid authored
285 raise
1b0c6f6 @larrytheliquid [#4] Cleanup latest release on deploy failures
larrytheliquid authored
286 end
427b315 @smerritt Bundle with the user's particular bundler version.
smerritt authored
287
288 def warn_about_missing_lockfile
0ffe959 @smerritt Ensure that informational messages go to the log.
smerritt authored
289 info "!>"
290 info "!> WARNING: Gemfile.lock is missing!"
291 info "!> You can get different gems in production than what you tested with."
292 info "!> You can get different gems on every deployment even if your Gemfile hasn't changed."
293 info "!> Deploying may take a long time."
294 info "!>"
295 info "!> Fix this by running \"git add Gemfile.lock; git commit\" and deploying again."
296 info "!> If you don't have a Gemfile.lock, run \"bundle lock\" to create one."
297 info "!>"
c9c3aaa @smerritt Make bundler versions methods, not constants.
smerritt authored
298 info "!> This deployment will use bundler #{default_09_bundler} to run 'bundle install'."
0ffe959 @smerritt Ensure that informational messages go to the log.
smerritt authored
299 info "!>"
427b315 @smerritt Bundle with the user's particular bundler version.
smerritt authored
300 end
301
696befc @smerritt Use bundler 1.0.0.rc.2 as default 1.0-series bundler.
smerritt authored
302 def get_bundler_installer(lockfile)
1f3428f @smerritt Move lockfile parsing into its own class. [#184]
smerritt authored
303 parser = LockfileParser.new(File.read(lockfile))
304 case parser.lockfile_version
305 when :bundler09
c6d507b @smerritt Use bundler 1.0.0 as default 1.0-series bundler.
smerritt authored
306 bundler_09_installer(parser.bundler_version || default_09_bundler)
1f3428f @smerritt Move lockfile parsing into its own class. [#184]
smerritt authored
307 when :bundler10
c6d507b @smerritt Use bundler 1.0.0 as default 1.0-series bundler.
smerritt authored
308 bundler_10_installer(parser.bundler_version || default_10_bundler)
1f3428f @smerritt Move lockfile parsing into its own class. [#184]
smerritt authored
309 else
310 raise "Unknown lockfile version #{parser.lockfile_version}"
427b315 @smerritt Bundle with the user's particular bundler version.
smerritt authored
311 end
312 end
696befc @smerritt Use bundler 1.0.0.rc.2 as default 1.0-series bundler.
smerritt authored
313 public :get_bundler_installer
427b315 @smerritt Bundle with the user's particular bundler version.
smerritt authored
314
c6d507b @smerritt Use bundler 1.0.0 as default 1.0-series bundler.
smerritt authored
315 def bundler_09_installer(version)
316 BundleInstaller.new(version, '--without=development --without=test')
317 end
318
319 def bundler_10_installer(version)
320 BundleInstaller.new(version,
321 "--deployment --path #{c.shared_path}/bundled_gems --binstubs #{c.binstubs_path} --without development test")
322 end
323
324 def default_09_bundler() "0.9.26" end
325 def default_10_bundler() "1.0.0" end
c9c3aaa @smerritt Make bundler versions methods, not constants.
smerritt authored
326
427b315 @smerritt Bundle with the user's particular bundler version.
smerritt authored
327 end # DeployBase
887b3db @adelcambre Refactor deployment
adelcambre authored
328
2f42987 @adelcambre OMG Huge patch
adelcambre authored
329 class Deploy < DeployBase
e7ca4c3 @smerritt Refactor EY::Server so that it doesn't need the Configuration object.
smerritt authored
330 def self.new(config)
79dad04 @adelcambre Move to cap style deployment
adelcambre authored
331 # include the correct fetch strategy
e7ca4c3 @smerritt Refactor EY::Server so that it doesn't need the Configuration object.
smerritt authored
332 include EY::Strategies.const_get(config.strategy)::Helpers
79dad04 @adelcambre Move to cap style deployment
adelcambre authored
333 super
334 end
335
887b3db @adelcambre Refactor deployment
adelcambre authored
336 end
90f77c1 @smerritt Create a REVISION file containing the deployed commit's SHA.
smerritt authored
337 end
Something went wrong with that request. Please try again.