package datakit-ci

  1. Overview
  2. Docs

Using Docker within the CI

type t
val create : logs:Live_log.manager -> pool:Monitored_pool.t -> timeout:float -> label:string -> string -> t

create ~logs ~pool ~timeout ~label dockerfile is a cache of Docker build results. dockerfile is the relative path to the Dockerfile within the source directory. label is a label to use in the branch name and should correspond to dockerfile but without any special characters that are invalid in branch names. For the common case, use create ~logs ~label:"Dockerfile" "Dockerfile".

module Image : sig ... end
val build : t -> ?from:Image.t -> Git.commit -> Image.t Term.t

build t src is the ID of the image generated by running `docker build` on src. If ~from:image is given, the initial "FROM" line in the file is replaced by "FROM image". This is useful if the base image is also being built by the CI.

type command
val command : logs:Live_log.manager -> pool:Monitored_pool.t -> timeout:float -> label:string -> ?entrypoint:string -> string list -> command

create ~logs ~pool ~timeout ~label args is a cache of Docker run results.

val run : command -> Image.t -> unit Term.t

run command image runs "docker run image command-args". It succeeds if the command returns with an exit status of zero.

OCaml

Innovation. Community. Security.