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) https://ideas.circleci.com/ideas/CCI-I-256
@jr0cket What's the problem? I usually install clojure
and that's all there is to it basically?
I do have a separate script for Mac builds, because the vanilla clojure script didn't work for me
Feel free to copy it 😉
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 https://github.com/babashka/pod-babashka-etaoin/blob/master/script/generate_circleci.clj
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: https://github.com/borkdude/carve
https://github.com/borkdude/carve/blob/master/.circleci/config.yml
I'm sure there are images that already have clojure
installed, but I don't bother with those, just make my own
https://circleci.com/docs/2.0/circleci-images/#clojure shows the images available for Clojure on Circle
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 :)
And there is a ton of tools-deps images there
Excellent, thats on my todo list now. Thanks.
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
.
I've added all the suggestions and ideas to this issue and will write up my experiences next week. https://github.com/practicalli/clojure-practicalli-content/issues/183 If anyone has any other suggestions or examples to share, I'll keep an eye out. Thank you all.
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 https://github.com/practicalli/clojure-deps-edn
@jr0cket next.jdbc
uses CircleCI https://github.com/seancorfield/next-jdbc/blob/develop/.circleci/config.yml
As does HoneySQL https://github.com/seancorfield/honeysql/blob/develop/.circleci/config.yml
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: https://github.com/seancorfield/next-jdbc/blob/develop/.github/workflows/test.yml#L8-L10
@seancorfield I choose to generate that matrix myself from a babashka script: https://github.com/babashka/babashka-sql-pods/blob/master/script/generate_circleci.clj
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...
@seancorfield I googled for you: https://circleci.com/blog/circleci-matrix-jobs/ 😉
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
Thank you @seancorfield