Documentation
Using `Makefile`
Run make help
for command line usage.
Prerequisites
To be able to build kubicorn
using Makefile you need to have a configured Go 1.8 environment, which you can set up by following the official install tutorial.
Before continuing, make sure that you can use the go
command from your shell.
Building kubicorn
Details about the building process can be found in BUILD docs and INSTALL docs.
The following make
commands are available for building kubicorn
:
make
— parse Bootstrap scripts and createkubicorn
executable in the./bin
directory and theAUTHORS
file.make compile
— create thekubicorn
executable in the./bin
directory.make install
— create thekubicorn
executable in$GOPATH/bin
directory.make build
— clean the project tree and generate thekubicorn
executables for 64-bit Linux, macOS, Windows and FreeBSD in the./bin
directory, as well as generate theAUTHORS
file.make clean
— removes files from the./bin
directory and thebootstrap/bootstrap.go
file.
Additional building commands
make build-linux-amd64
— create thekubicorn
executable for Linux 64-bit in the./bin
directory. Requires Docker.make build-darwin-amd64
— create thekubicorn
executable for macOS 64-bit in the./bin
directory.make build-freebsd-amd64
— create thekubicorn
executable for FreeBSD 64-bit in the./bin
directory.make build-windows-amd64
— create thekubicorn
executable for Windows 64-bit in the./bin
directory.
Miscellaneous
make authorsfile
— create theAUTHORS
file.make check-header
— verify all Go files to make sure they have license headers.make headers
— add license headers to the Go files who are missing them.
Formatting Go code
The following commands can be used to format and verify Go code:
make gofmt
— format all Go files usinggo fmt
.make lint
— check for style mistakes all Go files usinggolint
.make vet
— applygo vet
to all Go files.
Testing
make test
and make ci
are used to run tests and E2E tests. More about testing can be found in the test
package.
Makefile
verbose mode
By default, make
will not show which commands it runs. To see what exactly is being run, you need to set VERBOSE
variable, such as VERBOSE=1 make
.