Files
swift-hpa/justfile
Michael Housh 558054464c
Some checks failed
CI / Run Tests (push) Failing after 2m16s
Create and publish a Docker image / build-and-push-image (push) Has been cancelled
feat: Create backups of configuration when the force option is not used.
2024-12-17 14:38:52 -05:00

46 lines
936 B
Makefile

docker_image_name := "swift-hpa"
install_path := "~/.local/share/bin/hpa"
completion_path := "~/.local/share/zsh/completions/_hpa"
build mode="debug":
swift build -c {{mode}}
alias b := build
build-docker file="Dockerfile" tag="latest":
@docker build \
--file docker/{{file}} \
--tag {{docker_image_name}}:{{tag}} .
build-docker-test: (build-docker "Dockerfile.test" "test")
test *ARGS:
swift test {{ARGS}}
alias t := test
test-docker *ARGS: (build-docker-test)
@docker run --rm \
--network host \
{{docker_image_name}}:test \
swift test {{ARGS}}
run *ARGS:
swift run hpa {{ARGS}}
alias r := run
clean:
rm -rf .build
update-version:
@swift package \
--disable-sandbox \
--allow-writing-to-package-directory \
update-version \
hpa
install: (build "release")
@cp .build/release/hpa {{install_path}}
@{{install_path}} --generate-completion-script zsh > {{completion_path}}