summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Bartosh <eduard.bartosh@intel.com>2014-02-25 18:09:40 +0200
committerEd Bartosh <eduard.bartosh@intel.com>2014-03-18 17:29:47 +0200
commitbd31d521f618b2b457a56ff5fc6753eec1c7d4d7 (patch)
tree03e82500e9033f071b55f36f99cd9eacadafbd00
parenta0bb68980dc69a397d8166b992e7d9be36bfb158 (diff)
downloadrepa-bd31d521f618b2b457a56ff5fc6753eec1c7d4d7.tar.gz
repa-bd31d521f618b2b457a56ff5fc6753eec1c7d4d7.tar.bz2
repa-bd31d521f618b2b457a56ff5fc6753eec1c7d4d7.zip
Added obs and download urls to 'repa list' output
Repa gets both urls from correspondent fields in meta. If they aren't present in meta repa tries to guess them. Guessing part is temporary. It will be removed when backend provides urls. Fixes: #1674 Change-Id: I9f8f63572ae3407b08f1e9d0f7028d237f4fc1d9 Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com> Reviewed-on: https://otctools.jf.intel.com/review/10078 Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com> Reviewed-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rw-r--r--repa.134
-rwxr-xr-xrepa/list.py39
2 files changed, 58 insertions, 15 deletions
diff --git a/repa.1 b/repa.1
index b095310..7c1bb3b 100644
--- a/repa.1
+++ b/repa.1
@@ -72,27 +72,31 @@ Print short help text and exit.
List submissions in the following format:
Submission OBS project projects: list of projects paths
+ download url: url of prerelease directory on download server
+ obs url: url of prerelease OBS project
builds: list of package build statuses from OBS
images: list of image build statuses
.PP
Example of output:
-submit/tizen/20131204.010936 Tizen:Mobile projects: platform/upstream/smack
- builds: unresolvable,succeeded,published
- images: mobile-ref:success mobile:success
-
-submit/tizen/20131204.012119 Tizen:Mobile projects: platform/core/bash
- builds: unresolvable,succeeded,published
- images: mobile-ref:success mobile:success
-
-submit/tizen/20131204.012224 Tizen:Mobile projects: platform/upstream/git
- builds: unresolvable,succeeded,published
- images: mobile-ref:success mobile:success
-
-submitgroup/tizen/20131205.102345
- submissions: submit/tizen/20131204.010936 submit/tizen/20131204.012119
- images: mobile-ref:success mobile:success
+submit/tizen/20140225.081506 Tizen:IVI projects: platform/core/multimedia/libmm-log
+ download url: http://download.tizen.org/prerelease/tizen/ivi/ivi/tizen_20140226.8/tizen_20140226.8.20140225.081506/
+ obs url: https://build.tizen.org/project/show?project=home:prerelease:Tizen:IVI:submit:tizen:20140225.081506
+ builds: failed,succeeded,published
+ images: ivi-min-mbr-i586:success ivi-min-efi-i586:success ivi-mbr-i586-emul:success ivi-efi-i586:success ivi-mbr-i586:success
+
+submit/tizen/20140225.081550 Tizen:IVI projects: platform/core/multimedia/avsystem
+ download url: http://download.tizen.org/prerelease/tizen/ivi/ivi/tizen_20140226.8/tizen_20140226.8.20140225.081550/
+ obs url: https://build.tizen.org/project/show?project=home:prerelease:Tizen:IVI:submit:tizen:20140225.081550
+ builds: failed,succeeded,published
+ images: ivi-min-efi-i586:success ivi-min-mbr-i586:success ivi-mbr-i586-emul:success ivi-mbr-i586:success ivi-efi-i586:success
+
+submitgroup/tizen/20140226.232740
+ download url: http://download.tizen.org/prerelease/tizen/ivi/ivi/tizen_20140226.8/tizen_20140226.8.20140226.232740/
+ obs url: https://build.tizen.org/project/show?project=home:prerelease:Tizen:IVI:submitgroup:tizen:20140226.232740
+ submissions: 20140226.000818 20140226.002927 20140226.000750
+ images: ivi-min-efi-i586:success ivi-min-mbr-i586:success ivi-mbr-i586-emul:success ivi-mbr-i586:success ivi-efi-i586:success
.RE
diff --git a/repa/list.py b/repa/list.py
index 1c7b77c..2420e8f 100755
--- a/repa/list.py
+++ b/repa/list.py
@@ -30,6 +30,7 @@ Get list of submissions.
"""
import sys
+import os
import json
from repa.obs import OBS, OBS_PREFIX
@@ -54,6 +55,31 @@ def show_images(meta):
print ' images:', ' '.join("%s:%s" % (img['name'], img['status']) \
for img in meta['images'])
+def get_download_url(meta):
+ """Get download url from meta."""
+ if 'download_url' in meta:
+ return meta['download_url']
+ # Guess url from image url if download_url is not in the meta
+ if 'images' not in meta:
+ return
+ for img in meta['images']:
+ return img['url'].split('images')[0]
+
+
+def get_obs_url(meta, buildurl='https://build.tizen.org'):
+ """Get obs project url from meta."""
+ if 'obs_url' in meta:
+ return meta['obs_url']
+ # Make it from git tag and obs_target_prj if obs_url is not in the meta
+ if 'obs_target_prj' not in meta:
+ return
+ if 'name' not in meta and 'git_tag' not in meta:
+ return
+ name = meta.get('git_tag') or meta.get('name')
+ return os.path.join(buildurl, 'project/show?project=home:prerelease:%s:%s' \
+ % (meta['obs_target_prj'], name.replace('/', ':')))
+
+
def list_submissions(obs, regexp):
"""List submissions and groups."""
# submissions
@@ -65,6 +91,12 @@ def list_submissions(obs, regexp):
continue
print meta['git_tag'], meta['obs_target_prj'],
print ' projects: ', ' '.join(meta['projects'])
+ download_url = get_download_url(meta)
+ if download_url:
+ print ' download url: ', download_url
+ obs_url = get_obs_url(meta)
+ if obs_url:
+ print ' obs url: ', obs_url
print " builds:", get_status(obs, project)
show_images(meta)
print
@@ -72,6 +104,13 @@ def list_submissions(obs, regexp):
# groups
for meta in groups:
print meta['name']
+ download_url = get_download_url(meta)
+ if download_url:
+ print ' download url: ', download_url
+ obs_url = get_obs_url(meta)
+ if obs_url:
+ print ' obs url: ', obs_url
+
print ' submissions:', ' '.join(subm.split('/')[-1] \
for subm in meta['submissions'])
show_images(meta)