- Rename 'unlockers' command to 'unlocker' for consistency - Move all unlocker subcommands (list, add, remove) under single 'unlocker' command - Add --quiet/-q flag to 'secret list' for scripting support - Update documentation and tests to reflect command changes The quiet flag outputs only secret names without headers or formatting, making it ideal for shell script usage like: secret get $(secret list -q | head -1)
45 lines
887 B
Makefile
45 lines
887 B
Makefile
export CGO_ENABLED=1
|
|
export DOCKER_HOST := ssh://root@ber1app1.local
|
|
|
|
# Version information
|
|
VERSION := 0.1.0
|
|
GIT_COMMIT := $(shell git rev-parse HEAD 2>/dev/null || echo "unknown")
|
|
LDFLAGS := -X 'git.eeqj.de/sneak/secret/internal/cli.Version=$(VERSION)' \
|
|
-X 'git.eeqj.de/sneak/secret/internal/cli.GitCommit=$(GIT_COMMIT)'
|
|
|
|
default: check
|
|
|
|
build: ./secret
|
|
|
|
./secret: ./internal/*/*.go ./pkg/*/*.go ./cmd/*/*.go ./go.*
|
|
go build -v -ldflags "$(LDFLAGS)" -o $@ cmd/secret/main.go
|
|
|
|
vet:
|
|
go vet ./...
|
|
|
|
test: lint vet
|
|
go test ./... || go test -v ./...
|
|
|
|
fmt:
|
|
go fmt ./...
|
|
|
|
lint:
|
|
golangci-lint run --timeout 5m
|
|
|
|
check: build test
|
|
|
|
# Build Docker container
|
|
docker:
|
|
docker build -t sneak/secret .
|
|
|
|
# Run Docker container interactively
|
|
docker-run:
|
|
docker run --rm -it sneak/secret
|
|
|
|
# Clean build artifacts
|
|
clean:
|
|
rm -f ./secret
|
|
|
|
install: ./secret
|
|
cp ./secret $(HOME)/bin/secret
|