Fork me on GitHub
#babashka
<
2021-03-27
>
borkdude11:03:33

Some improvements to babashka/process 0.0.2: Tokenization: https://github.com/babashka/process#tokenization Example: (sh "ls -la") Note: automatic parsing of arg strings :extra-env option: https://github.com/babashka/process#add-environment

coolj13:03:43

@nha one quick way to get started with kubernetes is to wrap kubectl doing something like

(require '[clojure.java.shell :refer [sh]])
(-> (sh "kubectl" "get" "pod" "--all-namespaces" "-o" "json")
    :out
    (json/parse-string true)
    :items
    )

nha15:03:24

right, I know that’s an option, I was hoping to avoid shell wrapping but maybe that’s the easiest 😄

nate15:03:52

Yup, I have a wrapper around kubectl that helps cut down the verbosity of it. Works very well.

nate15:03:46

I've also wanted to generate k8s yaml via bb code, but that hasn't materialized yet.

nha16:03:08

right, there is verbosity but also potential state that’s in there too right? Like, login/which cluster is the default at the moment etc.

nha16:03:34

Better than plain bash for sure though I am considering bb + bash vs going with the java client

coolj18:03:55

There is https://github.com/nubank/k8s-api but it has some deps that are not part of babashka so you would need to create a babashka pod for it or just use a full clojure repl. It's also possible to use curl to interact with the api. btw, you can use kubectl to switch contexts in your script. Lots of choice here. But l agree with nate that bb with kubectl is surprisingly usable so it may be all you'll need for quick scripts.

👍 1
nha07:03:44

Thanks everyone, interesting feedback and pointers here 😄

borkdude13:03:24

Made some updates to the bb task runner (WIP). Documentation updated: https://github.com/babashka/babashka/issues/756 Discuss: https://github.com/babashka/babashka/issues/757 Play around: #babashka-circleci-builds (bb.edn branch binaries)

borkdude20:03:28

I was able to port antq's Makefile to bb.edn's new task runner: https://github.com/borkdude/antq/blob/bb.edn/bb.edn https://github.com/borkdude/antq/blob/bb.edn/Makefile

👌 1
💯 1
👏 1