summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlinaro-cp.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/linaro-cp.py b/linaro-cp.py
index 7c1d8c1..5757ec6 100755
--- a/linaro-cp.py
+++ b/linaro-cp.py
@@ -8,6 +8,7 @@ import pycurl
import sys
import tempfile
import time
+import re
# Public artifacts BUILD-INFO.txt
build_info = 'Format-Version: 0.5\n\nFiles-Pattern: *\nLicense-Type: open\n'
@@ -116,6 +117,8 @@ def main():
parser.add_argument('--server', default='http://snapshots.linaro.org/',
help='Publishing API server. default=%(default)s')
parser.add_argument('-b', '--build-info', help='Custom build-info file')
+ parser.add_argument('--split-job-owner', action='store_true',
+ help='Split Jenkins job owner in dst (owner_job -> ~owner/job)')
parser.add_argument('src', help='source directory with files to publish')
parser.add_argument('dst', help='destination to publish to')
@@ -143,6 +146,11 @@ def main():
else:
api = API_v2(arguments.server, arguments.build_info, key)
+ if arguments.split_job_owner:
+ # Rewrite job path .../owner_jobname/123 -> .../~owner/jobname/123 ,
+ # as required for android-build publishing.
+ arguments.dst = re.sub(r"^(.+?)/([^/]+?)_([^/]+?)/([0-9]+)/?$", r"\1/~\2/\3/\4/", arguments.dst)
+
transfer_failures = api.upload(arguments.src, arguments.dst)
if len(transfer_failures) > 0: