This repository has been archived on 2023-07-11. You can view files and clone it, but cannot push or open issues or pull requests.
vault-sidekick/Makefile
Rohith 95d966be0f - fixing up the test
- adding the coverage to the makefile as a reminder
2015-10-12 11:23:36 +01:00

48 lines
1 KiB
Makefile

NAME=vault-sidekick
AUTHOR=gambol99
HARDWARE=$(shell uname -m)
VERSION=$(shell awk '/Version =/ { print $$3 }' main.go | sed 's/"//g')
.PHONY: test authors changelog build docker static release
default: build
build:
mkdir -p bin
go build -o bin/${NAME}
docker: build
sudo docker build -t ${AUTHOR}/${NAME}:${VERSION} .
static:
mkdir -p bin
CGO_ENABLED=0 GOOS=linux go build -a -tags netgo -ldflags '-w' -o bin/${NAME}
push: docker
sudo docker tag -f ${AUTHOR}/${NAME}:${VERSION} docker.io/${AUTHOR}/${NAME}:${VERSION}
sudo docker push docker.io/${AUTHOR}/${NAME}:${VERSION}
release: static
mkdir -p release
gzip -c bin/${NAME} > release/${NAME}_${VERSION}_linux_${HARDWARE}.gz
rm -f release/${NAME}
clean:
rm -rf ./bin 2>/dev/null
rm -rf ./release 2>/dev/null
authors:
git log --format='%aN <%aE>' | sort -u > AUTHORS
cover:
go list ./... | xargs -n1 go test --cover
test: cover
go get
go get github.com/stretchr/testify/assert
go test -v
changelog: release
git log $(shell git tag | tail -n1)..HEAD --no-merges --format=%B > changelog