YS and CircleCI
Calva
is an integrated development environment for enjoyable and productive
Clojure
and ClojureScript
programming in Visual Studio Code
.
Calva uses CircleCI
for continuous integration and
deployment.
CircleCI requires a
.circleci/config.yml
file to define the build and
deployment steps.
YS Calva
Nearly all of the YS Project's
code
was written using Calva.
It's by far the best way to develop software with Clojure.
Calva's config.yml
file had grown to be quite large and complex, but after
refactoring it to use YS
,
it is now much more maintainable and easier to work with.
What started out as one big 636 line YAML file
with lots of embedded Bash scripts, was refactored into nearly 40 small files
each with
a clear and specific purpose.
You can see the how the migration was made over 30 single purpose commits in
this Pull Request
.
Now changes are made in a much more maintainable way, and the CircleCI required
config.yml
file is generated from the YS files using a simple ys
command:
$ ys -Y config.ys > config.yml
As a bonus, linting was performed on the Bash scripts (now in their own files) and several small issues were found and fixed.
This technique is a general strategy for refactoring large YAML files into smaller, more maintainable ones, regardless of whether or not the target system uses YS natively yet.