Commit 4b92d5a3 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

Merge branch 'rf/datefmt' into 'master'

MNT: looks like gitlab has changed its date format

See merge request fsl/fsl-ci-rules!92
parents f9a1c50a 170f987d
......@@ -19,7 +19,7 @@ import subprocess as sp
import yaml
__version__ = '0.16.7'
__version__ = '0.16.8'
"""Current version of the fsl-ci-rules."""
......
......@@ -599,10 +599,13 @@ def parse_gitlab_date(datestr):
"""2020-11-13T15:13:48.649Z
"""
timestamp = datestr.split('.')[0]
offset = datestr.split('Z')[1]
offset = datestr.split('+')[1]
if offset == '': offset = 0
else: offset = float(offset)
if offset == '':
offset = 0
else:
offset = (datetime.datetime.strptime(offset, '%H:%M') -
datetime.datetime(1900, 1, 1, 0, 0)).seconds / 3600.0
timestamp = datetime.datetime.strptime(timestamp, '%Y-%m-%dT%H:%M:%S')
offset = datetime.timezone(datetime.timedelta(hours=offset))
......
......@@ -147,8 +147,8 @@ def parseArgs(argv=None):
'token' : 'Gitlab API access token with read+write access',
'server' : f'Gitlab server (default: {SERVER_URL})',
'project' : 'Project(s) to build',
'production' : 'Deploy built package(s) to production cnannel '
'(default: deploy to staging channel)'
'production' : 'Build production/stable version '
'(default: label built package as staging/development)'
}
parser = argparse.ArgumentParser(usage=usage, description=desc)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment