Makefile is awesome!

This is a part of the 100 Days To Offload challenge.

Curiosity is piqued…

I had set up a local development environment for a project yesterday. Maybe 15 minutes and done? Super!

Primarily, it had a Makefile and a small but useful CONTRIBUTING.md file. Combined with asdf and prior knowledge of Docker, the whole thing was a breeze (you didn’t need to know Docker).

Lowering barriers.

Today, I followed my curiosity around this whole Makefile business and set up one up for a project at work. A complex README.md has now become much simpler!

I love it – new and junior developers to the project alike will have an easy time getting started. Nothing makes me happier.

Even an experienced developer who has no DevOps experience shouldn’t have to fiddle through the project readme to figure out how to get database logs. It should be as simple as possible.

In this process, some tedious CLI commands have become simpler for me too. Win-win.

A quick example.

I can now run make logs or make db to watch for container logs or start the database in detached mode respectively. This kind of abstraction is so nice. Here’s the corresponding commands that are run by make when I type those deceptively simple commands:

logs: ## Show logs from all containers running locally.
        docker-compose -f local.yml logs --follow
 
db: ## Launch a database container.
        docker-compose -f local.yml up -d db

I followed Victoria’s article on this topic; huge props to her!