practicalli / practicalli/clojure

Clojure deps projects with Circle CI

Open
#183 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

continuous integration
Dominant language
Makefile
Stars
117
Forks
36
PR merge metrics
No merged PRs in 30d

Description

Create a tutorial that shows how to set up a deps.edn project with CircleCI?

Documentation for a solved problem helps the community focus on solving other problems.

No tutorial was found in the Clojurians Slack archive or doing a web search (although Chris' Duct tutorial with Leiningen is very nice).
There are a sample config.yml files
https://github.com/borkdude/edamame/blob/master/.circleci/config.yml
https://github.com/borkdude/carve/blob/master/.circleci/config.yml
https://github.com/seancorfield/honeysql/blob/master/.circleci/config.yml
https://github.com/seancorfield/next-jdbc/blob/develop/.circleci/config.yml
https://github.com/borkdude/clj-kondo/blob/master/.circleci/config.yml

Create a canonical configuration, which can be easily updated with the version of Clojure CLI tools to use (to keep up with Alex)

CircleCI orbs

Content to create

Additional aspects

Using kaocha orb as a test runner (unit and generative testing)
https://circleci.com/orbs/registry/orb/lambdaisland/kaocha

Using Heroku orb for deployment to Heroku
https://circleci.com/developer/orbs/orb/betterdoc/deploy-to-heroku

Review other orbs
https://circleci.com/developer/orbs

Common approach

Install Clojure CLI as part of the config.yml steps
Windows is more challenging to install Clojure CLI, an alternative is to use borkedude deps.clj

use a vanilla jdk image rather than a clojure image with Leiningen if that tool is not used

Review Circle CI images

https://circleci.com/docs/2.0/circleci-images/#clojure shows the images available for Clojure on Circle which include images with tools.deps

The default image 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.

One challenge to writing a guide is that the deps.edn project setup is so free form, that it's hard to generalize into a non-parameterized recipe

Babashka script to generate a config.yml for multiple operating systems

https://github.com/babashka/pod-babashka-etaoin/blob/master/script/generate_circleci.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 (edited)

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the linked .circleci/config.yml examples with the CircleCI configuration reference and the Practicalli Clojure book structure. Define which deliverable is in scope, then document a canonical deps.edn setup, including the Clojure CLI version variable and any selected orb examples; done should mean the tutorial is complete and reproducible.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
ci-cd, documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.