mirror of
https://github.com/securego/gosec.git
synced 2024-12-27 13:05:51 +00:00
43 lines
995 B
Makefile
43 lines
995 B
Makefile
GIT_TAG?= $(shell git describe --always --tags)
|
|
BIN = gas
|
|
FMT_CMD = $(gofmt -s -l -w $(find . -type f -name '*.go' -not -path './vendor/*') | tee /dev/stderr)
|
|
IMAGE_REPO = docker.io
|
|
|
|
default:
|
|
$(MAKE) bootstrap
|
|
$(MAKE) build
|
|
|
|
bootstrap:
|
|
dep ensure
|
|
|
|
test: bootstrap
|
|
test -z '$(FMT_CMD)'
|
|
go vet $(go list ./... | grep -v /vendor/)
|
|
golint -set_exit_status $(shell go list ./... | grep -v vendor)
|
|
gas ./...
|
|
ginkgo -r -v
|
|
|
|
build:
|
|
go build -o $(BIN) ./cmd/gas/
|
|
|
|
clean:
|
|
rm -rf build vendor dist
|
|
rm -f release image bootstrap $(BIN)
|
|
|
|
release: bootstrap
|
|
@echo "Releasing the gas binary..."
|
|
goreleaser release
|
|
|
|
image: release
|
|
@echo "Building the Docker image..."
|
|
docker build -t $(IMAGE_REPO)/$(BIN):$(GIT_TAG) .
|
|
docker tag $(IMAGE_REPO)/$(BIN):$(GIT_TAG) $(IMAGE_REPO)/$(BIN):latest
|
|
touch image
|
|
|
|
image-push: image
|
|
@echo "Pushing the Docker image..."
|
|
docker push $(IMAGE_REPO)/$(BIN):$(GIT_TAG)
|
|
docker push $(IMAGE_REPO)/$(BIN):latest
|
|
|
|
.PHONY: test build clean release image image-push
|
|
|