File tree 6 files changed +25
-14
lines changed
6 files changed +25
-14
lines changed Original file line number Diff line number Diff line change @@ -14,25 +14,25 @@ tools:
14
14
parameters :
15
15
type : object
16
16
properties :
17
- project :
18
- type : string
19
- description : absolute path in the project root
20
17
path :
21
18
type : string
22
19
description : Path of the folder to delete
23
20
container :
24
21
image : vonwig/bash_alpine
25
22
mounts :
26
- - " {{project|safe}}:/workdir:ro"
27
- workdir : /workdir
23
+ - " {{path|safe}}:/dockerfile:ro"
28
24
command :
29
- - " cat {{path|safe}} "
25
+ - " cat /dockerfile "
30
26
prompt-format : " django"
27
+ arguments :
28
+ - name : path
29
+ description : path to the Dockerfile to explain
30
+ required : true
31
31
---
32
32
33
33
# prompt user
34
34
35
- Start by fetching the ./ Dockerfile in the project root at /Users/slim/docker/labs-ai-tools-for-devs .
35
+ Start by fetching the Dockerfile located at /dockerfile .
36
36
37
37
After fetching the Dockerfile contents, explain the Dockerfile line by line.
38
38
Original file line number Diff line number Diff line change 71
71
(when ref [ref]))}
72
72
(if (string/starts-with? (str dir) " /prompts" )
73
73
{:workdir (str dir)
74
- :volumes [" docker-prompts-git:/git" ]
75
- :mounts [ " docker-prompts:/prompts:rw" ]}
74
+ :volumes [" docker-prompts-git:/git"
75
+ " docker-prompts:/prompts:rw" ]}
76
76
{:host-dir (str dir)
77
77
:volumes [" docker-prompts-git:/git" ]}))))
78
78
Original file line number Diff line number Diff line change 1
1
(ns script )
2
2
3
3
(defmacro read [path]
4
- `(slurp ~path))
4
+ (slurp path))
5
+
6
+ (comment
7
+ (macroexpand '(read " src/volumes/collect.clj" )))
Original file line number Diff line number Diff line change 71
71
{:mounts (->> (-> definition :container :mounts )
72
72
(map (fn [s] (first (interpolate arg-context s))))
73
73
(into []))})
74
+ (when (-> definition :container :volumes )
75
+ {:volumes (->> (-> definition :container :volumes )
76
+ (map (fn [s] (first (interpolate arg-context s))))
77
+ (into []))})
74
78
; ; workdirs in a container definition will always override ones
75
79
; ; set in the metadata
76
80
(when-let [wd (or
Original file line number Diff line number Diff line change 48
48
(->
49
49
(docker/run-container
50
50
{:image " vonwig/bb:latest"
51
- :volumes [" /Users/slim/slimslenderslacks/flask-nix-example :/project" ]
51
+ :volumes [" /Users/slim:/project" ]
52
52
:workdir " /project"
53
53
:command [(json/generate-string
54
- {:thread-id " blah " })
55
- " {} " ]})
54
+ {:directory " /project " })
55
+ ( script/read " src/volumes/collect.clj " ) ]})
56
56
:pty-output
57
- (json/parse-string keyword)))
57
+ #_ (json/parse-string keyword)))
58
58
Original file line number Diff line number Diff line change 3
3
" pass in args"
4
4
(def args {:directory " /Users/slim" }))
5
5
6
+ (require '[clojure.java.io :as io])
7
+ (require '[babashka.fs :as fs])
8
+ (require '[cheshire.core :as json])
9
+
6
10
(defn file->bytes [path]
7
11
(with-open [in (io/input-stream path)
8
12
out (java.io.ByteArrayOutputStream. )]
You can’t perform that action at this time.
0 commit comments