Fork me on GitHub

Is there a tutorial that shows how to set up a deps.edn project with CircleCI? Looking through the archive of this channel and doing a web search, I found no such thing (although Chris' Duct tutorial with Leiningen is very nice). I have a few sample config.yml files from the archived and borkdudes babashka generator.. If there isnt a tutorial, I'll figure this all out and write up what I discovered and add it to the Practicalli Clojure book and maybe do a broadcast on the subject. Any feedback / suggestions welcome.


Oh and I voted for the related CircleCI issue (making 3 votes)


@jr0cket What's the problem? I usually install clojure and that's all there is to it basically?


Hmm, I will let you know how I get on over the weekend then...


Most of my projects have an "install clojure" step


For Windows it's annoying, there I use my own project called deps.clj


For the bb script, I assme this is run from the root of the Clojure project you wish to generate the config.yml from


The only reason I'm generating the circleci config there is that there's a matrix of builds: two executables for three OSes


I'd like to have some documentation that shows how to do this without searching through the clojurian slack archives. If its a solved problem, then documentation helps the community solve other problems.


A more normal JVM project example would be:


I'm sure there are images that already have clojure installed, but I don't bother with those, just make my own


I havent seen anything yet with Clojure CLI installed, only Leiningen. I would take the approach sean did of using a vanilla jdk image rather than a clojure image with a tool I was not using The cli install is the same approach I've used for other projects in the past, its been a while since I set all this up, so examples will help speed this all up. Thanks for the pointers. I work on this next week and see how much comes flooding back :)


I do have a separate script for Mac builds, because the vanilla clojure script didn't work for me


Feel free to copy it 😉

slipset11:06:07 shows the images available for Clojure on Circle

👍 1

Excellent, thats on my todo list now. Thanks.


And there is a ton of tools-deps images there


Things are looking more promising than I thought, thanks.


The default for a clojure project seems to be to set it up with the circleci/clojure:lein-2.7.1 image.


Interestingly, it seems as if Circle autodetects that your project is a Clojure project, maybe Circle could be taught to detect if its a deps or a lein project as well.


Lots of things to test then 🙂 Thanks.


Just tell me to be quiet when you've had enough of my ramblings, but I see one problem and it would be that if you were to write a tutorial on this, the deps.edn project setup is so free form, that it's hard to generalize into a non-parameterized recipe


Like circle's default clojure-setup has lein test as their run thingy. That could be literally whatever if you use deps.edn


Please ramble on, its very useful understanding your experiences and comments...


Nothing profound here, other than that lein test is a thing in the leiningen world but in hte deps.edn world, it's up to the user to name the alias, so running your tests with deps.edn could be clj -A:test, clj -A:koacha, or clj -A:xyzzy .


If everyone used my practicalli/clojure-deps-edn configuration then that wouldnt be a problem 🙂 (I dont expect everyone to do this)


So I guess (and I'm sure you're aware of) if you're writing a tutorial on setting up a project with deps.edn, it would be wise to suggest good names for the aliases (which should probably not be the name of the thing implementing the feature, eg clj -A:test over clj -A:kaocha (and clj -A:uberjar over clj -A:depstar or whatever)


Classic. If everyone would just do as I said, the world would be such a great place 🙂


I have chosen what I believe to be descriptive names for the aliases used in that configuration, especially where there are multiple options for the same task


I've added all the suggestions and ideas to this issue and will write up my experiences next week. If anyone has any other suggestions or examples to share, I'll keep an eye out. Thank you all.


It's very easy to tell GitHub Actions to run a matrix of tests on different Java (JDK) versions. Is that easy to set up on CircleCI as well? next.jdbc runs tests on JDKs 8, 11, and 14:


much easier than being dependent on some CI's DSL


but maybe CircleCI does support it, don't know


Yeah, I was looking at that script -- which is why I asked 🙂 I find CircleCI's docs pretty hard to navigate when you're looking for a specific "how-to" answer...


in my case I had to make one build but with one different environment variable for three values


I see now that I could have done that using the matrix stuff (although even @marc-omorain did not mention it when I showed him my script ;))


Ah, it's been a few months since I last went looking and that seems to be new in April. Thank you @borkdude!


(I do remember reading something about Orbs at some point but felt it was a weird name and very poorly explained in the docs -- and looking at that blog post, it's a lot of boilerplate just to define matrix when compared to something like GitHub Actions!)


with the "do it yourself" scripting approach, I can prevent learning all these config DSLs, which is a win to me personally