mirror of
https://github.com/wweir/sower.git
synced 2026-10-19 16:14:33 +00:00
install.sh was only syntax-checked (sh -n), so the install and upgrade paths, the config-preservation contract and the failure modes for a malformed release tarball had no coverage. Add an offline, unprivileged E2E test that builds its own tarballs and installs into a temp prefix with --service none: fresh install, an in-place upgrade that keeps an operator-edited config, --with-server, a dry run that creates nothing, three malformed tarballs that must fail closed, and the CLI surface. Wire it into make test as test-install and syntax-check the new script.
40 lines
800 B
Makefile
40 lines
800 B
Makefile
MAKEFLAGS += --jobs all
|
|
GO:=CGO_ENABLED=0 go
|
|
|
|
default: test build
|
|
|
|
test: web check-scripts test-install
|
|
${GO} vet ./...
|
|
${GO} test ./...
|
|
|
|
.PHONY: check-scripts
|
|
check-scripts:
|
|
sh -n install.sh
|
|
sh -n install_e2e_test.sh
|
|
sh -n .github/sower.init
|
|
|
|
.PHONY: test-install
|
|
test-install:
|
|
sh install_e2e_test.sh
|
|
|
|
build: sower sowerd
|
|
.PHONY: web
|
|
web:
|
|
cd web && bun install --frozen-lockfile && bun run build
|
|
|
|
.PHONY: sower
|
|
sower: web
|
|
${GO} build -ldflags "\
|
|
-X main.version=$(shell git describe --tags --always) \
|
|
-X main.date=$(shell date +%Y-%m-%d)" \
|
|
-o sower ./cmd/sower
|
|
.PHONY: sowerd
|
|
sowerd:
|
|
${GO} build -ldflags "\
|
|
-X main.version=$(shell git describe --tags --always) \
|
|
-X main.date=$(shell date +%Y-%m-%d)" \
|
|
-o sowerd ./cmd/sowerd
|
|
|
|
clean:
|
|
rm -f sower sowerd sower.exe sowerd.exe
|