Sign in

Make

We use make to drive our build workflow. This is configured using a Makefile.

The Makefile serves as a contract between development and CI/CD and should include the following targets.

  • build
  • configure
  • lint
  • test

Add these targets on an as needed basis.

  • integration-test
  • doc
  • docker

Skeleton

IMAGE = my-docker-image
TAG = latest
APP_VERSION = 0.0.1

# build will execute when running just make
build: clean configure lint test
	echo "Build the software artifact"

clean:
	echo "Deleting dynamically created files"

configure:
	echo "Configure the local environment, download dependencies etc"

lint:
	echo "Verify code quality"

test:
	echo "Run unit tests and code coverage"

integration-test:
	echo "Run integration tests"

doc:
	echo "Build documentation artifact"

docker:
	echo "Building Docker image"
	docker build \
		-t $(IMAGE):$(TAG) \
		--build-arg APP_VERSION=$(APP_VERSION) \
		-f Dockerfile .
	echo "$(IMAGE):$(TAG)"

.PHONY: build clean configure lint test integration-test doc docker

Editorconfig rules

[Makefile]
indent_style = tab