summary refs log tree commit diff
diff options
context:
space:
mode:
authorMathieu Othacehe <othacehe@gnu.org>2020-06-14 21:53:57 +0200
committerMathieu Othacehe <othacehe@gnu.org>2020-06-15 09:15:08 +0200
commit4e05bbb093a17145fcabd48ea1d2c9cd7559084d (patch)
tree258a9dc7f7cdef7f6ea5cb23a3ea69b0d91092e0
parentb64ca5dadccf42b84b72e83e16e3581b4cf56094 (diff)
downloadguix-4e05bbb093a17145fcabd48ea1d2c9cd7559084d.tar.gz
ci: Add build products support.
* guix/ci.scm (<build-product>): New json mapping,
(<build)[products]: new field.
-rw-r--r--guix/ci.scm16
1 files changed, 15 insertions, 1 deletions
diff --git a/guix/ci.scm b/guix/ci.scm
index 8fd05668f2..e1016ef566 100644
--- a/guix/ci.scm
+++ b/guix/ci.scm
@@ -52,13 +52,27 @@
 ;;;
 ;;; Code:
 
+(define-json-mapping <build-product> make-build-product
+  build-product?
+  json->build-product
+  (type        build-product-type)
+  (file-size   build-product-file-size)
+  (path        build-product-path))
+
 (define-json-mapping <build> make-build build?
   json->build
   (id          build-id "id")                     ;integer
   (derivation  build-derivation)                  ;string | #f
   (system      build-system)                      ;string
   (status      build-status "buildstatus" )       ;integer
-  (timestamp   build-timestamp))                  ;integer
+  (timestamp   build-timestamp)                   ;integer
+  (products    build-products "buildproducts"     ;<build-product>*
+               (lambda (products)
+                 (map json->build-product
+                      ;; Before Cuirass 3db603c1, #f is always returned.
+                      (if products
+                          (vector->list products)
+                          '())))))
 
 (define-json-mapping <checkout> make-checkout checkout?
   json->checkout