alpha_omega 0.0.134 → 0.0.135

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/alpha_omega/deploy.rb +7 -13
  3. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.134
1
+ 0.0.135
@@ -112,6 +112,7 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
112
112
  _cset(:release_path) { File.join(releases_path, release_name) }
113
113
  _cset(:previous_path) { File.join(deploy_to, previous_dir) }
114
114
  _cset(:current_path) { File.join(deploy_to, current_dir) }
115
+ _cset(:external_path) { current_path }
115
116
  _cset(:next_path) { File.join(deploy_to, next_dir) }
116
117
  _cset(:service_path) { File.join(deploy_to, service_dir) }
117
118
  _cset(:service_drop) { File.join(deploy_to, ".#{service_dir}.d") }
@@ -301,21 +302,19 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
301
302
  on_rollback do
302
303
  if rollback_release
303
304
  run "rm -fv #{previous_path} #{next_path}; true"
304
- run "#{File.dirname(current_path).index(deploy_to) == 0 ? "" : try_sudo} ln -vsnf #{rollback_release} #{current_path}; true"
305
+ run "ln -vsnf #{rollback_release} #{current_path}; true"
305
306
  else
306
307
  logger.important "no previous release to rollback to, rollback of symlink skipped"
307
308
  end
308
309
  end
309
310
 
310
311
  if releases.length == 1
311
- run "[[ $(readlink #{current_path} 2>&-) = #{latest_release} ]] || #{try_sudo} ln -vsnf #{latest_release} #{current_path}"
312
+ run "ln -vsnf #{latest_release} #{current_path}"
312
313
  else
313
314
  run "rm -fv #{previous_path} #{next_path}"
314
- if current_path == "#{deploy_to}/current"
315
- run "#{File.dirname(current_path).index(deploy_to) == 0 ? "" : try_sudo} ln -vsnf #{latest_release} #{current_path}"
316
- else
317
- run "ln -vsnf #{latest_release} #{deploy_to}/current"
318
- run "#{File.dirname(current_path).index(deploy_to) == 0 ? "" : try_sudo} ln -vsnf #{deploy_to}/current #{current_path}"
315
+ run "ln -vsnf #{latest_release} #{current_path}"
316
+ if current_path != external_path
317
+ run "#{File.dirname(external_path).index(deploy_to) == 0 ? "" : try_sudo} ln -vsnf #{current_path} #{external_path}"
319
318
  end
320
319
  run "ln -vsnf #{rollback_release} #{previous_path}"
321
320
  end
@@ -404,12 +403,7 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
404
403
  system "#{figlet} -w 200 on #{previous_release}"
405
404
  run "rm -fv #{previous_path} #{next_path}"
406
405
 
407
- if current_path == "#{deploy_to}/current"
408
- run "#{File.dirname(current_path).index(deploy_to) == 0 ? "" : try_sudo} ln -vsnf #{previous_release} #{current_path}"
409
- else
410
- run "ln -vsnf #{previous_release} #{deploy_to}/current"
411
- run "#{File.dirname(current_path).index(deploy_to) == 0 ? "" : try_sudo} ln -vsnf #{deploy_to}/current #{current_path}"
412
- end
406
+ run "ln -vsnf #{previous_release} #{current_path}"
413
407
  else
414
408
  abort "could not rollback the code because there is no prior release"
415
409
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alpha_omega
3
3
  version: !ruby/object:Gem::Version
4
- hash: 275
4
+ hash: 273
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 134
10
- version: 0.0.134
9
+ - 135
10
+ version: 0.0.135
11
11
  platform: ruby
12
12
  authors:
13
13
  - David Nghiem