This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-06-04
Channels
- # announcements (13)
- # asami (68)
- # babashka (19)
- # beginners (51)
- # calva (4)
- # cider (3)
- # clj-kondo (13)
- # clojure (161)
- # clojure-australia (3)
- # clojure-europe (21)
- # clojure-nl (4)
- # clojure-spec (9)
- # clojure-sweden (13)
- # clojure-uk (9)
- # clojured (14)
- # clojurescript (7)
- # conjure (4)
- # cursive (16)
- # data-science (2)
- # datalog (1)
- # figwheel-main (7)
- # graalvm (18)
- # helix (14)
- # introduce-yourself (1)
- # jackdaw (9)
- # jobs (1)
- # kaocha (1)
- # malli (8)
- # meander (8)
- # off-topic (7)
- # pathom (11)
- # proletarian (3)
- # shadow-cljs (29)
- # tools-deps (106)
- # xtdb (8)
I'm trying to use bb tasks as Makefile replacement.
How to import environment variables?
like set -a ;; source .../myenv ;; ...
now I do
:tasks
{
dev (shell "bash -c 'set -ae ; source VARS ; source ${DEV_ENV} && clojure -M:dev:nrepl'")
}
@maxp Hi! In babashka I use the following method: 1. I can set and control any value by means of config files in EDN-format. I don't need ENV vars in most cases. See example https://github.com/redstarssystems/rssyslib/blob/4de3fa36fcf6fa629f4340bbefacd4842bddc606/bb.edn#L14 2. When I need to set ENV vars for subprocess I do it like this https://github.com/redstarssystems/rssyslib/blob/4de3fa36fcf6fa629f4340bbefacd4842bddc606/bb.edn#L46 3. To read ENV vars I use cprop function from-env
@mike1452 you don't have to use env
to pass environment variables to a child process, you can use (shell {:extra-env {"FOO" "BAR"}} ....)
Documented here: https://book.babashka.org/#_shell
Can something similar be achieved before launching something with (clojure ...)
? (setting env vars)
By the way, I did write very simple caching for BB on CircleCI, it's not particularly smart but it works and allow for upgrading version: https://gist.github.com/helins/59e3abfc96f7a641d608a314fb6b8665
Simply breaks the line, otherwise it was sometimes misbehaving in my terminal. But you could simplify it to something like this it seems: [ -f "bb.tar.gz" ] && tar -xzvf bb.tar.gz
I forgot pretty much everything I knew about Bash...