This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-10-01
Channels
- # announcements (5)
- # aws (2)
- # babashka (35)
- # beginners (68)
- # bristol-clojurians (1)
- # calva (14)
- # cider (9)
- # clj-commons (5)
- # clojars (3)
- # clojure (101)
- # clojure-australia (6)
- # clojure-europe (35)
- # clojure-italy (2)
- # clojure-nl (5)
- # clojure-spec (1)
- # clojure-uk (4)
- # clojurescript (70)
- # conjure (3)
- # cursive (7)
- # datomic (36)
- # emacs (11)
- # exercism (1)
- # fulcro (23)
- # helix (2)
- # jobs-discuss (15)
- # lsp (17)
- # malli (8)
- # meander (1)
- # nrepl (60)
- # off-topic (10)
- # pedestal (9)
- # react (8)
- # reagent (53)
- # reveal (10)
- # shadow-cljs (27)
- # spacemacs (4)
- # tools-build (4)
- # tools-deps (4)
- # xtdb (2)
@U0666UM3J you can see an exmaple here:
https://github.com/bob-cd/bob/blob/main/apiserver/bb.edn#L49-L50
and
https://github.com/bob-cd/bob/blob/main/apiserver/build.clj
the uberjar is built by running bb compile
from this dir
@U7ERLH6JX - btw, you can use (clojure " ..." ) instead of (shell "clojure ...")
yep i had considered it, however this runs on a CI and it needs to download things everytime and by shelling out to clojure i can cache things. i can cache the deps from bb too but got too lazy to wirte it 😛
You can’t yet use the API straight from bb. A lot of parts are compatible but the tools deps alpha stuff and compile stuff inevitably needs a JVM
@U7ERLH6JX if you use bb clojure the caching should be identical to invoking clojure from within bb
@U04V15CAJ it needs a download of deps.clj right? if i use (clojure ...)
? is that also in the standard ~/.m2 path?
It’s an uberjar so it doesn’t belong in m2. The Clojure CLI itself saves it in .clojure
yeah so this is the download that i did not cache part i was referring to 😅, now that i know it, i will add it to the list of folders to cache
I’m also considering reusing the Clojure tools jar from the already installed Clojure CLI
Hello! Any libraries/pods available in Babashka for managing various time stuff? Mainly interested in taking a timestamp and making it into human readable "1 hour and 2 minutes ago" or similar
@UEJ5FMR6K java.time
is available. some clojure time libs based on that work, like cljc.time
.
Would babashka be useful for pulling out a value from an AWS secret manager and setting a local environment variable? For example, get a database password from an AWS secret which holds host, db, password, etc values I assume a bb script would shell out to the aws CLI tool and get the JSON response, then pull out the desired value from that JSON data and then shell out create the environment variable. Does that sound reasonable / possible? Update: I could also try using the congnitect aws-api
I do it all the time in bb, it is awesome for scripting aws tasks. You can use aws-pod or just call aws cli, both ways work. I've started with wrapping aws cli and then ported to aws-pod once it was available.
Yeah you can't set environment variables in bb, but you can however create new processes that have that env var set
@jr0cket One trick I've applied in the past is to spit bash output and then source
that with bash. That's a way you can set env vars :)
Here is that hack: https://stackoverflow.com/a/64804398/6264
writing env vars to a file and sourcing it would be nice. There is one env var I want to set most days (an auth0 token authorization token). The filter should find the right env var and set it to the new token value. I'll also try with the aws cli as it may also be useful to set env vars in the clojure REPL (to avoid having to restart the REPL).
@jr0cket You can't set environment variables within a JVM process. The environment is immutable. However, you can create new processes that contain the new environment variable from that JVM process.
Hmm, I think attempts to use the bb aws-pod are failing because we use single sign-on (using aws-valut). So will need to figure that bit out before I go any further. Thanks for all the idea.
I can call babashka scripts using aws-vault like so
aws-vault exec profile-name -- bb script.clj
aws-valut starts the single sign-on process for my aws account and then runs the bb script
I can also run a repl using aws-vault with the server flag to refresh credentials
aws-vault exec profile-name --server -- clojure -M:repl/rebel