Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Change ls options to '-xr' to stop nondeterministic deploy:rollback behavior. #6

Closed
wants to merge 2 commits into
from
Jump to file or symbol
Failed to load files and symbols.
+3 −1
Split
View
@@ -28,6 +28,8 @@ def _cset(name, *args, &block)
_cset(:deploy_to) { "/u/apps/#{application}" }
_cset(:revision) { source.head }
+_cset(:ls_opts) { "-xt" }
+
# =========================================================================
# These variables should NOT be changed unless you are very confident in
# what you are doing. Make sure you understand all the implications of your
@@ -51,7 +53,7 @@ def _cset(name, *args, &block)
_cset(:current_path) { File.join(deploy_to, current_dir) }
_cset(:release_path) { File.join(releases_path, release_name) }
- _cset(:releases) { capture("ls -xt #{releases_path}").split.reverse }
+ _cset(:releases) { capture("ls #{ls_opts} #{releases_path}").split.reverse }
_cset(:current_release) { File.join(releases_path, releases.last) }
_cset(:previous_release) { releases.length > 1 ? File.join(releases_path, releases[-2]) : nil }