summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2018-01-20 14:10:55 +0200
committerLars Wirzenius <liw@liw.fi>2018-01-20 14:10:55 +0200
commitb074c71ae56046942db693292a22f0263e82e9f2 (patch)
tree6aef5e59f36d572efa2456ee3df88fea7f7ec934
parentfbc669358923665491267363fb77a6a33648e7f4 (diff)
downloadick2-b074c71ae56046942db693292a22f0263e82e9f2.tar.gz
Add: icktool show-latest-log
-rw-r--r--NEWS3
-rwxr-xr-xicktool12
2 files changed, 15 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index e1630d7..0a398ce 100644
--- a/NEWS
+++ b/NEWS
@@ -28,6 +28,9 @@ Version 0.22+git, not yet released
* Builds are now named `foo/123` (build 123 of project foo). Logs
similarly.
+* New command: `icktool show-latest-log foo` shows the latest log for
+ the `foo` project.
+
Version 0.22, released 2018-01-15
----------------------------------
diff --git a/icktool b/icktool
index 3ad8c60..881cc68 100755
--- a/icktool
+++ b/icktool
@@ -307,6 +307,18 @@ class Icktool(cliapp.Application):
self._report(code, 200, text)
self.output.write(text)
+ def cmd_show_latest_log(self, args):
+ project = args[0]
+ builds = self._get_builds()
+ project_builds = [
+ b
+ for b in builds['builds']
+ if b['project'] == project
+ ]
+ if project_builds:
+ b = project_builds[-1]
+ self.cmd_show_log([b['build_id']])
+
def cmd_get_blob(self, args):
blob_id = args[0]
blob_api = self._new_blob_api()