ocurrent / obuilder

Experimental "docker build" alternative using btrfs/zfs snapshots
Apache License 2.0
60 stars 17 forks source link

Improve formatting of OBuilder specs #45

Closed talex5 closed 3 years ago

talex5 commented 4 years ago

Before:

((from
  ocaml/opam@sha256:b2245cea39ed16fd39bd7ab70204b28fb73d1364e1bc702ef495798349e55e4f)
 (comment debian-10-4.10) (user (uid 1000) (gid 1000))
 (run (cache (opam-archives (target /home/opam/.opam/download-cache)))
  (network host) (shell "opam install dune.2.7.1"))
 (run (cache (opam-archives (target /home/opam/.opam/download-cache)))
  (network host)
  (shell
   "opam pin add -n https://github.com/ocamllabs/duniverse.git#6b6c1b8173afab88933762f6b5ee82a070b2d715"))
 (run (cache (opam-archives (target /home/opam/.opam/download-cache)))
  (network host) (shell "opam depext --update -y opam-monorepo"))
 (run (cache (opam-archives (target /home/opam/.opam/download-cache)))
  (network host) (shell "opam install opam-monorepo"))
 (workdir /src) (run (shell "sudo chown opam /src"))
 (copy (src dune-project rwo.opam rwo.opam.locked) (dst /src/))
 (run (cache (opam-archives (target /home/opam/.opam/download-cache)))
  (network host) (shell "opam pin -n add rwo . --locked"))
 (run (cache (opam-archives (target /home/opam/.opam/download-cache)))
  (network host) (shell "opam depext --update -y rwo"))
 (run (cache (opam-archives (target /home/opam/.opam/download-cache)))
  (network host) (shell "opam pin remove rwo"))
 (run (cache (opam-archives (target /home/opam/.opam/download-cache)))
  (network host) (shell "opam exec -- opam monorepo pull"))
 (copy (src .) (dst /src/))
 (run
  (cache
   (dune:realworldocaml:book (target /src/_build)
    (buildkit_options ((sharing private)))))
  (shell "opam exec -- dune build @install"))
 (run
  (cache
   (dune:realworldocaml:book (target /src/_build)
    (buildkit_options ((sharing private)))))
  (shell "opam exec -- dune runtest")))

After:

((from ocaml/opam@sha256:b2245cea39ed16fd39bd7ab70204b28fb73d1364e1bc702ef495798349e55e4f)
 (comment debian-10-4.10)
 (user (uid 1000) (gid 1000))
 (run (cache (opam-archives (target /home/opam/.opam/download-cache)))
      (network host)
      (shell "opam install dune.2.7.1"))
 (run (cache (opam-archives (target /home/opam/.opam/download-cache)))
      (network host)
      (shell "opam pin add -n https://github.com/ocamllabs/duniverse.git#6b6c1b8173afab88933762f6b5ee82a070b2d715"))
 (run (cache (opam-archives (target /home/opam/.opam/download-cache)))
      (network host)
      (shell "opam depext --update -y opam-monorepo"))
 (run (cache (opam-archives (target /home/opam/.opam/download-cache)))
      (network host)
      (shell "opam install opam-monorepo"))
 (workdir /src)
 (run (shell "sudo chown opam /src"))
 (copy (src dune-project rwo.opam rwo.opam.locked) (dst /src/))
 (run (cache (opam-archives (target /home/opam/.opam/download-cache)))
      (network host)
      (shell "opam pin -n add rwo . --locked"))
 (run (cache (opam-archives (target /home/opam/.opam/download-cache)))
      (network host)
      (shell "opam depext --update -y rwo"))
 (run (cache (opam-archives (target /home/opam/.opam/download-cache)))
      (network host)
      (shell "opam pin remove rwo"))
 (run (cache (opam-archives (target /home/opam/.opam/download-cache)))
      (network host)
      (shell "opam exec -- opam monorepo pull"))
 (copy (src .) (dst /src/))
 (run (cache (dune:realworldocaml:book (target /src/_build) (buildkit_options ((sharing private)))))
      (shell "opam exec -- dune build @install"))
 (run (cache (dune:realworldocaml:book (target /src/_build) (buildkit_options ((sharing private)))))
      (shell "opam exec -- dune runtest"))
)