2021-05-07 19:55:29 +00:00
|
|
|
DOCKER_TAG ?= vaultwarden_ldap_${USER}
|
2020-07-09 19:04:05 +00:00
|
|
|
|
|
|
|
.PHONY: all
|
|
|
|
all: test check release
|
|
|
|
|
|
|
|
# Default make target will run tests
|
|
|
|
.DEFAULT_GOAL = test
|
|
|
|
|
|
|
|
# Build debug version
|
2021-05-07 19:55:29 +00:00
|
|
|
target/debug/vaultwarden_ldap: src/
|
2020-07-09 19:04:05 +00:00
|
|
|
cargo build
|
|
|
|
|
|
|
|
# Build release version
|
2021-05-07 19:55:29 +00:00
|
|
|
target/release/vaultwarden_ldap: src/
|
2020-07-09 19:04:05 +00:00
|
|
|
cargo build --locked --release
|
|
|
|
|
|
|
|
.PHONY: debug
|
2021-05-07 19:55:29 +00:00
|
|
|
debug: target/debug/vaultwarden_ldap
|
2020-07-09 19:04:05 +00:00
|
|
|
|
|
|
|
.PHONY: release
|
2021-05-07 19:55:29 +00:00
|
|
|
release: target/release/vaultwarden_ldap
|
2020-07-09 19:04:05 +00:00
|
|
|
|
|
|
|
# Run debug version
|
|
|
|
.PHONY: run-debug
|
2021-05-07 19:55:29 +00:00
|
|
|
run-debug: target/debug/vaultwarden_ldap
|
|
|
|
target/debug/vaultwarden_ldap
|
2020-07-09 19:04:05 +00:00
|
|
|
|
|
|
|
# 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) .
|
2020-09-28 21:58:23 +00:00
|
|
|
|
|
|
|
.PHONY: docker-build-alpine
|
|
|
|
docker-build-alpine:
|
|
|
|
docker build -f ./Dockerfile.alpine -t $(DOCKER_TAG):alpine .
|