|
|
@ -1,6 +1,7 @@ |
|
|
.PHONY: all test unit-test syntax-test e2e-test lint clean prerequisites |
|
|
PREFIX ?= /usr/local |
|
|
|
|
|
.PHONY: all test unit-test syntax-test e2e-test lint clean prerequisites install |
|
|
|
|
|
|
|
|
all: syntax-test unit-test lint |
|
|
all: syntax-test unit-test e2e-test lint install |
|
|
|
|
|
|
|
|
syntax-test: |
|
|
syntax-test: |
|
|
@echo "Running syntax tests..." |
|
|
@echo "Running syntax tests..." |
|
|
@ -14,13 +15,32 @@ prerequisites: |
|
|
|
|
|
|
|
|
unit-test: prerequisites |
|
|
unit-test: prerequisites |
|
|
@echo "Running unit tests..." |
|
|
@echo "Running unit tests..." |
|
|
@LANG=LC_ALL=C BATS_LIB_PATH=$(PWD)/test/test_helper bats test/unit |
|
|
@LANG=C LC_ALL=C BATS_LIB_PATH=$(PWD)/test/test_helper bats test/unit |
|
|
|
|
|
|
|
|
e2e-test: prerequisites |
|
|
e2e-test: prerequisites |
|
|
@echo "Running end-to-end tests..." |
|
|
@echo "Running end-to-end tests..." |
|
|
@LANG=LC_ALL=C BATS_LIB_PATH=$(PWD)/test/test_helper bats test/e2e |
|
|
@LANG=C LC_ALL=C BATS_LIB_PATH=$(PWD)/test/test_helper bats test/e2e |
|
|
|
|
|
|
|
|
|
|
|
install: |
|
|
|
|
|
@echo "Installing zvirt..." |
|
|
|
|
|
@install -d $(PREFIX)/lib/zvirt |
|
|
|
|
|
@install -m 755 src/bin/zvirt $(PREFIX)/bin/zvirt |
|
|
|
|
|
@install -m 644 src/lib/zvirt/core.sh $(PREFIX)/lib/zvirt/core.sh |
|
|
|
|
|
|
|
|
|
|
|
uninstall: |
|
|
|
|
|
@echo "Uninstalling zvirt..." |
|
|
|
|
|
@rm -f $(PREFIX)/bin/zvirt |
|
|
|
|
|
@rm -rf $(PREFIX)/lib/zvirt |
|
|
|
|
|
|
|
|
|
|
|
release: |
|
|
|
|
|
@echo "Creating release tarball..." |
|
|
|
|
|
@set -Eeuo pipefail; VERSION=$$(git describe --tags --abbrev=0); tar --exclude-vcs --exclude='*.swp' -czf zvirt-$$VERSION.tar.gz --transform "s|^src|zvirt-$$VERSION|" src |
|
|
|
|
|
|
|
|
|
|
|
install-release: |
|
|
|
|
|
@echo "Installing zvirt from release tarball..." |
|
|
|
|
|
@set -Eeuo pipefail; VERSION=$$(git describe --tags --abbrev=0); tar -xvzf zvirt-$$VERSION.tar.gz --strip-components=1 -C $(PREFIX) |
|
|
|
|
|
|
|
|
clean: |
|
|
clean: |
|
|
lint: |
|
|
lint: |
|
|
@echo "Linting..." |
|
|
@echo "Linting..." |
|
|
@shellcheck src/zvirt src/lib/*.sh |
|
|
@shellcheck src/bin/zvirt src/lib/zvirt/*.sh |
|
|
|