Skip to content

Latest commit

 

History

History
71 lines (53 loc) · 2.02 KB

README.md

File metadata and controls

71 lines (53 loc) · 2.02 KB

ACRL build-scripts

Build scripts for Applied Computing Research Labs projects

To use:

Add this repo as a submodule in your repo:

git submodule add https://github.com/acrlabs/build-scripts build

Create a Makefile in your project defining a list of build artifacts in the ARTIFACTS variable; Then, include build/base.mk, and then define a build target for $(ARTIFACTS). You should also define build targets for test, lint, and cover` (these can be empty if you don't want to do anything here). Note the ordering is important here.

You can reference $(BUILD_DIR) and $(K8S_MANIFEST_DIR) in your build targets.

The default build target is build image run which builds your artifacts, creates Docker images for them, and deploys them to your Kubernetes cluster. You can also run make verify to run lint test cover.

If you want to change the behaviour of the run target, redefine the RUN_COMMANDS variable after including the base Makefile, as follows:

include build/base.mk

define RUN_COMMANDS
    command1
    command2
    ...
endef

Example project makefile:

ARTIFACTS=binary1 binary2

include build/base.mk

$(ARTIFACTS):
	CGO_ENABLED=0 go build -trimpath -o $(BUILD_DIR)/$@ ./cmd/$@

lint:
	golangci-lint run

cover:
	go-carpet -summary

CC0
To the extent possible under law, Applied Computing Research Labs, LLC has waived all copyright and related or neighboring rights to this work. This work is published from: United States.