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

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
4 participants

Lee:

We use rsync to deploy code, and it leaves the timestamps all screwy for reasons I can't quite figure, so 'ls -xt' doesn't produce correct results, while 'ls -xr' does.

I understand if this patch won't product correct behavior for people who name their releases differently. If that's the case, please reject it, but would it make sense to provide some user-visible setting to alter the ls options? That seems like a more correct choice, but it's more than a 1-character change. =)

Chris


Change ls options from -xt to -xr, which fixes nondeterministic rollback behavior when our releases are named 20110404210241 (YYYYMMDDHHMMSS) but our modification times are unreliable (apparently because of rsync). Best thing would be to have the ls options be user-settable.

randomcamel added some commits Apr 4, 2011

@randomcamel randomcamel Change ls options from -xt to -xr, which fixes nondeterministic rollb…
…ack behavior when our releases are named 20110404210241 (YYYYMMDDHHMMSS) but our modification times are unreliable (apparently because of rsync). Best thing would be to have the ls options be user-settable.
f10e323
@randomcamel randomcamel Expose an 'ls_opts' variable that users can set in deploy.rb. f23bd3f
Contributor

leehambley commented Apr 5, 2011

Chris,

Thanks - I might make it an option for Rspec users, something like this is
worth having… maybe we look upstream and see if there's a flag for RSync
which would do the same?

  • Lee

On 4 April 2011 23:19, randomcamel <
reply@reply.github.com>wrote:

Lee:

We use rsync to deploy code, and it leaves the timestamps all screwy for
reasons I can't quite figure, so 'ls -xt' doesn't produce correct results,
while 'ls -xr' does.

I understand if this patch won't product correct behavior for people who
name their releases differently. If that's the case, please reject it, but
would it make sense to provide some user-visible setting to alter the ls
options? That seems like a more correct choice, but it's more than a
1-character change. =)

Chris


Change ls options from -xt to -xr, which fixes nondeterministic rollback
behavior when our releases are named 20110404210241 (YYYYMMDDHHMMSS) but our
modification times are unreliable (apparently because of rsync). Best thing
would be to have the ls options be user-settable.

Reply to this email directly or view it on GitHub:
leehambley#6

Lee:

I'll be frank, I have no idea how this might be useful to anyone else outside railsless-deploy. :-) It became sort of an urgent thing for me, because without it, deploy:rollback deletes a semi-random release and symlinks back to some other semi-random release. That may or may not be my co-worker's fault with the rsync deploy task we use. It's possible something more general is appropriate, like passing a full Unix command to produce a correctly--ordered list of releases.

Chris

koenvw commented Oct 19, 2012

Hi, I came across this also and the nondeterministic behavior has been fixed in capistano by sorting the releases in ruby and not via ls.

See capistrano/capistrano@8638f22#lib/capistrano/recipes/deploy.rb

plentz commented Mar 11, 2013

+1

Contributor

leehambley commented Aug 9, 2013

leehambley closed this Aug 9, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment