Fork me on GitHub
#boot
<
2016-10-22
>
hlship07:10:26

Back to this after getting the kids down. Kind of pounding against a brick wall here. This is what I have so far:

hlship07:10:44

(deftask docker-template
  "Adds the directory to the fileset.  TODO: So much more."
  [d dir DIR file "Directory to add."]
  (let [tmp (tmp-dir!)]
    (with-pre-wrap [fs]
      (empty-dir! tmp)
      (-> fs
          (add-resource dir)
          commit!))))

(deftask build-docker-image
  "Runs Docker in a shell to build an image from the fileset."
  [i image-name NAME str "Name of the image to build."
   v version VERSION str "Version (appended to the image name)"]
  (let [work-dir (tmp-dir!)]
    (with-pass-thru [fs]
      (apply sync! work-dir (input-files fs))
      (util/dosh "ls" "-lag" (.getPath work-dir))
      (util/dosh "docker"
                 "-t" (str image-name ":" version)))))

hlship07:10:26

This doesn’t work, ClassCastException.

hlship07:10:06

In build-docker-image I’d like to create a real folder with the files added in docker-template, so that I can pass the directory to the docker command.

hlship07:10:44

sync! seems like the right thing, but I don’t have the rest. Ah, just tried (apply sync! work-dir (output-dirs fs)) and that seems happier.

hlship07:10:57

Still mixes in source code from my project, which is puzzling, but should do no harm.

flyboarder15:10:40

@hlship take a look at the boot-bower/boot-npm tasks, I am creating a directory and passing it to an exec there also

borkdude20:10:11

Updated boot-bundle with some new features and unit tests. https://github.com/borkdude/boot-bundle/blob/master/README.md#versions