circleci

rm -rf /home/circleci/.gitconfig
practicalli-john 2020-06-26T10:59:20.015500Z

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.

practicalli-john 2020-06-26T11:00:46.016100Z

Oh and I voted for the related CircleCI issue (making 3 votes) https://ideas.circleci.com/ideas/CCI-I-256

borkdude 2020-06-26T11:01:13.016800Z

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

borkdude 2020-06-26T11:02:52.017900Z

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

borkdude 2020-06-26T11:02:59.018100Z

Feel free to copy it 😉

practicalli-john 2020-06-26T11:02:59.018200Z

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

borkdude 2020-06-26T11:03:19.018500Z

Most of my projects have an "install clojure" step

borkdude 2020-06-26T11:03:37.018800Z

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

practicalli-john 2020-06-26T11:06:53.019Z

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

borkdude 2020-06-26T11:07:50.019400Z

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

practicalli-john 2020-06-26T11:08:00.019600Z

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.

borkdude 2020-06-26T11:08:29.019800Z

A more normal JVM project example would be: https://github.com/borkdude/carve

borkdude 2020-06-26T11:09:36.020600Z

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

slipset 2020-06-26T11:12:07.021Z

https://circleci.com/docs/2.0/circleci-images/#clojure shows the images available for Clojure on Circle

👍 1
practicalli-john 2020-06-26T11:12:12.021200Z

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 :)

slipset 2020-06-26T11:12:38.021700Z

And there is a ton of tools-deps images there

practicalli-john 2020-06-26T11:12:46.021800Z

Excellent, thats on my todo list now. Thanks.

practicalli-john 2020-06-26T11:13:13.022Z

Things are looking more promising than I thought, thanks.

slipset 2020-06-26T11:14:11.022200Z

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

slipset 2020-06-26T11:14:57.022400Z

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.

practicalli-john 2020-06-26T11:15:45.022600Z

Lots of things to test then 🙂 Thanks.

slipset 2020-06-26T11:17:21.022800Z

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

slipset 2020-06-26T11:18:20.023Z

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

practicalli-john 2020-06-26T11:22:27.023200Z

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

slipset 2020-06-26T11:35:21.024400Z

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 .

practicalli-john 2020-06-26T11:35:28.024700Z

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.

practicalli-john 2020-06-26T11:36:54.025Z

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

slipset 2020-06-26T11:37:45.025200Z

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)

slipset 2020-06-26T11:38:10.025400Z

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

practicalli-john 2020-06-26T11:40:01.025700Z

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

seancorfield 2020-06-26T16:18:32.026200Z

@jr0cket next.jdbc uses CircleCI https://github.com/seancorfield/next-jdbc/blob/develop/.circleci/config.yml

seancorfield 2020-06-26T16:18:56.026500Z

As does HoneySQL https://github.com/seancorfield/honeysql/blob/develop/.circleci/config.yml

seancorfield 2020-06-26T16:56:35.028Z

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

borkdude 2020-06-26T17:19:54.028500Z

@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

borkdude 2020-06-26T17:20:10.029Z

much easier than being dependent on some CI's DSL

borkdude 2020-06-26T17:20:39.029400Z

but maybe CircleCI does support it, don't know

seancorfield 2020-06-26T17:23:04.030300Z

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...

borkdude 2020-06-26T17:23:46.030500Z

@seancorfield I googled for you: https://circleci.com/blog/circleci-matrix-jobs/ 😉

borkdude 2020-06-26T17:24:33.031300Z

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

borkdude 2020-06-26T17:25:25.031900Z

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 ;))

seancorfield 2020-06-26T17:46:03.032700Z

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

seancorfield 2020-06-26T17:49:07.034200Z

(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!)

borkdude 2020-06-26T17:51:33.034800Z

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

practicalli-john 2020-06-26T20:19:33.034900Z

Thank you @seancorfield