Coverage report: /home/ellis/comp/core/app/skel/comp/container.lisp

KindCoveredAll%
expression066 0.0
branch00nil
Key
Not instrumented
Conditionalized out
Executed
Not executed
 
Both branches taken
One branch taken
Neither branch taken
1
 ;;; container.lisp --- Containerfile Components
2
 
3
 ;; Containerfile skel components.
4
 
5
 ;;; Commentary:
6
 
7
 ;; By convention we consider any file with base-name 'Containerfile'
8
 ;; (case-sensitive) to be an OCI Containerfile. Extension is used as the name
9
 ;; of the containerfile, or if absent defaults to the directory name.
10
 
11
 ;;; Code:
12
 (in-package :skel/comp/container)
13
 
14
 (defclass sk-containerfile (sk-component containerfile)
15
   ())
16
 
17
 (defmethod print-object ((object sk-containerfile) stream)
18
   (print-unreadable-object (object stream :type t)
19
     (format stream "~A" (file-namestring (path object)))))
20
 
21
 (defmethod sk-convert ((self containerfile))
22
   (let ((self (change-class self 'sk-containerfile)))
23
     (update-id self)
24
     self))
25
 
26
 (defmethod sk-load-component ((kind (eql :containerfile))
27
                               (name pathname)
28
                               &optional (path (project-root)))
29
   (declare (ignore kind))
30
   (sk-convert (deserialize
31
                (make-pathname :name *default-containerfile* :type (namestring name)
32
                               :directory (namestring path))
33
                :containerfile)))
34
 
35
 (defmethod sk-write-file ((self sk-containerfile) &key path)
36
   (serde self (pathname (or path (path self)))))
37
 
38
 (defmethod sk-read-file ((self sk-containerfile) path)
39
   (sk-load-component :containerfile path))
40
 
41
 (defmethod sk-build ((self sk-containerfile) &key with-client no-cache tag)
42
   (typecase with-client
43
     (null (apply 'pod::run-podman (flatten (concatenate 'list
44
                                                         `("build" "-f"
45
                                                                   ,(path self)
46
                                                                   ,@(when no-cache (list "--no-cache")))
47
                                                         (when tag (list "-t" tag ))))))
48
     ;; iff == t
49
     (boolean
50
      (with-libpod-client (c)
51
        (libpod-request-json c "containers/json")
52
        (nyi! "need to implement containerfile libpod request method")))
53
     ;; else
54
     (t (with-libpod-client (c with-client)
55
          (nyi! "todo")))))