Skip to content

Commit

Permalink
Sort by version
Browse files Browse the repository at this point in the history
  • Loading branch information
Rupert Bedford committed May 23, 2016
1 parent ea37f47 commit 8284a15
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fabfile.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import os
import re
from pkg_resources import parse_version

from fabric.api import task, put, run, cd


@task
def deploy(archive=None, name='radar-client'):
if archive is None:
# Use the latest archive by default
archive = sorted(x for x in os.listdir('.') if x.endswith('.tar.gz'))[-1]
archive = sorted(filter(lambda x: x.endswith('.tar.gz'), os.listdir('.')), key=parse_version)[-1]

version = re.search('-([^-]+)\.tar\.gz$', archive).group(1)
current_version = '/srv/{name}/current'.format(name=name)
Expand Down

0 comments on commit 8284a15

Please sign in to comment.