mirror of
https://github.com/hauler-dev/hauler.git
synced 2026-02-14 18:09:51 +00:00
* bump cosign to v2.2.3-carbide.3 * use new annotation in 'store info' when listing images Signed-off-by: Adam Martin <adam.martin@ranchergovernment.com> --------- Signed-off-by: Adam Martin <adam.martin@ranchergovernment.com>
52 lines
1.2 KiB
Makefile
52 lines
1.2 KiB
Makefile
# Makefile for hauler
|
|
|
|
# set shell
|
|
SHELL=/bin/bash
|
|
|
|
# set go variables
|
|
GO_FILES=$(shell go list ./... | grep -v /vendor/)
|
|
GO_COVERPROFILE=coverage.out
|
|
|
|
# set cosign variables
|
|
COSIGN_VERSION=v2.2.3+carbide.3
|
|
|
|
# set build variables
|
|
BIN_DIRECTORY=bin
|
|
DIST_DIRECTORY=dist
|
|
BINARIES_DIRECTORY=cmd/hauler/binaries
|
|
|
|
# builds hauler for current platform
|
|
# references other targets
|
|
build: install fmt vet test
|
|
goreleaser build --clean --snapshot --single-target
|
|
|
|
# builds hauler for all platforms
|
|
# references other targets
|
|
build-all: install fmt vet test
|
|
goreleaser build --clean --snapshot
|
|
|
|
# install depedencies
|
|
install:
|
|
rm -rf $(BINARIES_DIRECTORY)
|
|
mkdir -p $(BINARIES_DIRECTORY)
|
|
wget -P $(BINARIES_DIRECTORY) https://github.com/hauler-dev/cosign/releases/download/$(COSIGN_VERSION)/cosign-$(shell go env GOOS)-$(shell go env GOARCH)
|
|
go mod tidy
|
|
go mod download
|
|
CGO_ENABLED=0 go install ./cmd/...
|
|
|
|
# format go code
|
|
fmt:
|
|
go fmt $(GO_FILES)
|
|
|
|
# vet go code
|
|
vet:
|
|
go vet $(GO_FILES)
|
|
|
|
# test go code
|
|
test:
|
|
go test $(GO_FILES) -cover -race -covermode=atomic -coverprofile=$(GO_COVERPROFILE)
|
|
|
|
# cleanup artifacts
|
|
clean:
|
|
rm -rf $(BIN_DIRECTORY) $(BINARIES_DIRECTORY) $(DIST_DIRECTORY) $(GO_COVERPROFILE)
|