mirror of
https://github.com/ViViDboarder/bitwarden_rs_ldap.git
synced 2024-11-24 12:16:26 +00:00
91d70e6bb8
This adds pre-commit hooks installable using the provided Makefile as well as a new check to validate the version in the Cargo file matches the git tag. This will be useful as a check before pushing releases.
55 lines
995 B
Makefile
55 lines
995 B
Makefile
DOCKER_TAG ?= bitwarden_rs_ldap_${USER}
|
|
|
|
.PHONY: all
|
|
all: test check release
|
|
|
|
# Default make target will run tests
|
|
.DEFAULT_GOAL = test
|
|
|
|
# Build debug version
|
|
target/debug/bitwarden_rs_ldap: src/
|
|
cargo build
|
|
|
|
# Build release version
|
|
target/release/bitwarden_rs_ldap: src/
|
|
cargo build --locked --release
|
|
|
|
.PHONY: debug
|
|
debug: target/debug/bitwarden_rs_ldap
|
|
|
|
.PHONY: release
|
|
release: target/release/bitwarden_rs_ldap
|
|
|
|
# Run debug version
|
|
.PHONY: run-debug
|
|
run-debug: target/debug/bitwarden_rs_ldap
|
|
target/debug/bitwarden_rs_ldap
|
|
|
|
# Run all tests
|
|
.PHONY: test
|
|
test:
|
|
cargo test
|
|
|
|
# Installs pre-commit hooks
|
|
.PHONY: install-hooks
|
|
install-hooks:
|
|
pre-commit install --install-hooks
|
|
|
|
# Checks files for encryption
|
|
.PHONY: check
|
|
check:
|
|
pre-commit run --all-files
|
|
|
|
# Checks that version matches the current tag
|
|
.PHONY: check-version
|
|
check-version:
|
|
./scripts/check-version.sh
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
rm -f ./target
|
|
|
|
.PHONY: docker-build
|
|
docker-build:
|
|
docker build -f ./Dockerfile -t $(DOCKER_TAG) .
|