X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=Makefile;h=fa2db0bbd326f4a4f3da2dfc9e3ef8b531460a41;hb=9d0d090fc1d683accc8bd1b354425c23cbe9fb6a;hp=ddde397b2ce427b5995cce8933a426332b17aa36;hpb=7557c0d7a00e9c73056ae202264893daf8533aa6;p=safcm%2Fsafcm.git diff --git a/Makefile b/Makefile index ddde397..fa2db0b 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,8 @@ LDFLAGS = '\ -X "main.versionGit=$(shell git describe --long --tags --dirty --always)" \ -X "main.versionGo=$(shell go version)" \ ' +# Build with `make GOFLAGS=` if -race is not supported +GOFLAGS=-race all: safcm @@ -9,12 +11,30 @@ all: safcm safcm: go fmt ./... cd cmd/safcm-remote && ./build.sh - go build -ldflags $(LDFLAGS) -race ruderich.org/simon/safcm/cmd/safcm + go build $(GOFLAGS) -ldflags $(LDFLAGS) ruderich.org/simon/safcm/cmd/safcm + +test: @# For proper permissions after initial clone with a strict umask cd cmd/safcm/testdata/project && ../../../../safcm fixperms 2> /dev/null + @# + ./cmd/safcm/testdata/ssh/prepare.sh + go vet ./... + go test $(GOFLAGS) ./... + +lint: + shellcheck ci/run + shellcheck cmd/safcm-remote/build.sh + shellcheck cmd/safcm/testdata/ssh/prepare.sh clean: rm -rf remote/helpers/ rm -f safcm + rm -f cmd/safcm/testdata/ssh/ssh/authorized_keys + rm -f cmd/safcm/testdata/ssh/ssh/id_ed25519 + rm -f cmd/safcm/testdata/ssh/ssh/id_ed25519.pub + rm -f cmd/safcm/testdata/ssh/ssh/known_hosts + rm -f cmd/safcm/testdata/ssh/sshd/ssh_host_key + rm -f cmd/safcm/testdata/ssh/sshd/ssh_host_key.pub + rm -rf cmd/safcm/testdata/ssh/project/no-changes.example.org/ -.PHONY: all clean safcm +.PHONY: all test clean safcm