Fix old version cleanup to sort by modified date
I was sorting by version name, which _was_ reliable until I changed my version name format, and then a deploy cleaned up the version it had just deployed because it no longer sorted to the end! Rather than be dependent on a stable version name format, and set myself up for more surprises, I'm going to instead use the folder's modified time. While there could be surprising ways for folder timestamps to be updated, I expect it to be _more_ reliable overall.
This commit is contained in:
parent
bddcf91c02
commit
c13114b0cc
1 changed files with 2 additions and 2 deletions
|
@ -57,10 +57,10 @@
|
|||
cmd: yarn install
|
||||
|
||||
- name: Find older versions to clean up
|
||||
# Print out all but the last 5 versions
|
||||
# Print out all but the 5 last-recently-updated versions
|
||||
command:
|
||||
chdir: /srv/impress-2020/versions
|
||||
cmd: bash -c 'ls | head -n -5'
|
||||
cmd: bash -c 'ls -t | tail -n +6'
|
||||
register: versions_to_clean_up
|
||||
|
||||
- name: Clean up older versions
|
||||
|
|
Loading…
Reference in a new issue