Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

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
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/railsless-deploy.rb
Expand Up @@ -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
Expand All @@ -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 }

Expand Down